Refining CodeMRI Diagnostics - File Attributes

In order to mark files as 3rd party, create a "User-Defined Architecture" file that tells CodeMRI which files to mark as 3rd party. The set of files to mark as third party are defined by a set of wildcard expressions. 

 

Here is a basic example of a User Defined Architecture file marking files under src/lib/* as third party.

{     "properties": [         {             "name": "fp_ThirdParty",             "values": [                 {                     "name": "True",                     "assignments": [{                         "subject": {"type": "file"},                         "group": [{"type": "inclusion", "matchers": {"name": {"match": ["src/lib/*"]}}}]                     }]                 }             ]         }     ] }

I recommend using the system file list command to list the files in your codebase, figuring out which ones are third party, and then changing the "src/lib/*" expression in the above example to one that matches the open source files in your codebase. 

 

First load the shell.

$ cmri shell --vault /path/to/vault

 

Next, select your system, then list the files.

> select project/system-version

> system file list

 

You can test expressions using the --name option on the system file list command:

 

> system file list --name 'src/lib/*'

 

After creating your user defined architecture file, save it to a uda.json file anywhere on your system, and update your system configuration to point to it:

 

> system config set uda_file "/path/to/uda.json"

 

Before re-running the reports, I recommend running system architecture verify to make sure your architecture file is valid.

 

Next time you run "job run produce_reports", CodeMRI should pick up the user-defined architecture file and update your reports. If you are on Windows, be sure to close any open reports before re-running produce_reports.

 

NOTE – there is a CLI Reference Guide that you may find helpful. It can be located at http://codemri.com under the ‘Downloads’ tab.

 

To access the documentation, unzip the CLI_Reference_and_Migration_Guide.zip file, and open up CLIReference.pdf under the CLI Reference and Migration Guide folder in your preferred web browser.

 

After opening the pdf file, click “Command Listing” then "system" on the left navigation bar to expand the "system" command listing. You can then view the "architecture" section to access the documentation for user defined architecture.

 

This documentation is also available in textual form via CLI by running cmri system architecture --help.