...
Use job run generate_query_data
, and you’re ready to start.
Querying
Components
In order to query components, component relationships, files, or file relationships, you will need the names of components or files. The component Component names are user-defined, but can be found using system component list
. That will return a list that resembles the following:
...
while file and entity names are collected by CodeMRI.
Components
List components Additional command info
The NAME
column should be used for querying
Code Block |
---|
system component list SYSTEM NAME EXPRESSIONS FILE COUNT linux/linux-1.0 boot linux/boot/* 2 linux/linux-1.0 fs linux/fs/* 19 linux/linux-1.0 include linux/include/* 31 linux/linux-1.0 init linux/init/* 1 linux/linux-1.0 kernel linux/kernel/* 18 |
The NAME
column should be used for querying, as such:
Code Block |
---|
> system query components ... |
Query components
Code Block |
---|
system query components --name kernel
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
name kernel
file_count 13
fan_in 5
fan_out 5
files_in_cyclic_group 10 |
...
| The name of the component. |
| The number of files inside the component. |
| How many components directly depend on the component. |
| How many components are directly depended on by the component. |
| The number of files within the component that are members of a cyclic group. A cyclic group is a group of files that are, either directly or indirectly, circularly dependent upon each other. |
Component Relationships
List component
...
relationships
...
Additional command info
Code Block |
---|
system component-relationship list
SYSTEM FROM TO
linux/linux-1.0 kernel boot |
Query component relationships
system query component-relationship
uses requires --from-component
and --to-component
flags:
...
| The component that uses the to_component. |
| The component used by the from_component. |
| The type of relationship between the components. See Component Relationship Types for more information. |
| The state of the relationship as determined by CodeMRI. See Relationship States for more information. |
| A coarse indicator of the level of attention to pay to a given relationship. See query#Severities for more information. |
| The number of files involved in the given component relationship. Will be |
| The number of entities involved in the given component relationship. Will have a value of |
Files
...
Files
Querying may display files not present in the reports. CodeMRI removes files deemed “isolates” from reports. A file is an “isolate” if:
it does not depend on any other files.
no other files depend on it.
List files
...
Additional command info
Code Block |
---|
system file list SYSTEM COMPONENT NAME LANGUAGE LINES OF CODE linux/linux-1.0 fs list SYSTEM COMPONENT linux/fs/bitmap.c NAME C LANGUAGE LINES OF 158CODE linux/linux-1.0 fs linux/fs/block_devbitmap.c C 158 86 linux/linux-1.0 fs linux/fs/buffer.c C block_dev.c C 254 9586 ... |
Query files
system query files
drops the appended linux/
in the --name
flag. For example:
...
| The relative path of the file. May include wildcard expressions. |
| The component in which the file resides. May include wildcard expressions. |
| Restrict the search to files assigned to the given list of files tagged with the provided list of file property / value combinations. At time of writing, the only recognized value for file properties is |
| The programming language of the file, as detected by static analysis. May include wildcard expressions. |
| The McCabe complexity class of the file. Must be one of the following: |
| |
| |
| |
| |
| |
| Restrict search to files indirectly dependent upon a given file or set of files matching the given expression. |
Fields:
| The relative path of the file. |
| The component the file resides in. |
| The programming language of this file detected by static analysis. |
| The number of entities contained in this file. |
| The number of files that directly depend on this file. |
| The number of files this file directly depends on. |
|
|
| The ID of the cyclic group this file is part of. |
| The size, in files, of the cyclic group this file belongs to. |
| A simplified representation of the complexity of this file. |
| The cyclomatic complexity of this file. |
| The number of source lines within the file. |
| The ratio of comment lines to source lines within this file. |
| Property values assigned to the given file. |
File Relationships
...
| |
| Restrict search to files indirectly dependent upon a given file or set of files matching the given expression. |
Fields:
| The relative path of the file. |
| The component the file resides in. |
| The programming language of this file detected by static analysis. |
| The number of entities contained in this file. |
| The number of files that directly depend on this file. |
| The number of files this file directly depends on. |
|
|
| The ID of the cyclic group this file is part of. |
| The size, in files, of the cyclic group this file belongs to. |
| A simplified representation of the complexity of this file. |
| The cyclomatic complexity of this file. |
| The number of source lines within the file. |
| The ratio of comment lines to source lines within this file. |
| Property values assigned to the given file. |
File Relationships
File relationships are _____________
List file relationships
Code Block |
---|
system file_relationship list
# |
Query file relationships
system query file_relationship
uses --from-file
and --to-file
flags
Code Block |
---|
system query file_relationships --from-file ______ --to-file _______
# |
Filters:
| The name of file that uses the |
| The name of the file used by the |
| The component containing the file that uses the |
| The component containing the file used by the |
| Files tagged with the file property matching the given property/value combination. At time of writing the only supported value is |
| Files tagged with the file property matching the given property/value combination. At time of writing the only supported value is |
| The state of the relationship between the files. Must be one or more of: |
| A coarse indicator of the level of attention to pay to a given relationship. Must be one of: |
| Restrict search to files indirectly dependent upon a given file or set of files matching the given expression. |
| The cyclic group ID of the file that uses the |
| The cyclic group ID of the file used by the |
...
| The file that uses the |
| The file used by the |
| The component that uses the |
| The component used by the |
| Property values assigned to the file on the |
| Property values assigned to the file on the |
| The state of the relationship. See Relationship States for more information. |
| A coarse indicator of the level of attention to pay to a given relationship. See query#Severities for more information. |
| The number of entities involved in the given file relationship. |
Entities
Entities are __
List entities
Code Block |
---|
system entity list # |
Query entities
Code Block |
---|
system query entities --name # |
Filters:
| The name of the entity. May include wildcard expressions. |
| The type of the entity. May include wildcard expressions. |
| The file the entity is contained in. May include wildcard expressions. |
| The component the entity is contained in. May include wildcard expressions. |
| The language of the file the entity is contained in. May include wildcard expressions. |
| The McCabe complexity class of the file. Must be one of the following: |
| |
| |
| |
| |
|
...
| The name of the entity. |
| The type of the entity. Please note that these types are not standardized across static analysis engines. |
| The relative path of the file that owns the entity. |
| The component that owns the entity. If the entity is not part of any component, this field will be blank. |
| Whether the entity is in a group of entities that are circularly dependent on each other. |
| The ID of the cyclic group the entity belongs to. Will be |
| The number of files in the cyclic group the entity belongs to. Will be |
| The programming language the owning file was written in, as detected by the static analysis engine. |
| The McCabe complexity of the entity, as determined by static analysis. May not be valid for all entity types, will be |
| The McCabe complexity class of the entity, as determined by CodeMRI. May not be valid for all entity types, will be |
| The number of lines of code (LOC) in the entity. May not be valid for all entity types, will be |
| The ratio of comment lines to source lines in the entity. May not be valid for all entity types, will be |
Entity Relationships
...
Entity relationships are ________________
List entity relationships
Code Block |
---|
# |
Query entity relationships
Code Block |
---|
# |
Filters:
| The name of the entity that uses |
| The name of the entity used by the |
| The file that owns the |
| The file that owns the |
| The name of the component that owns the |
| The name of the component that owns the |
| The state of the relationship between the |
| The weight of the relationship state. Can be overridden by the user. Must be one of |
...