public interface ICoreAccess
Modifier and Type | Method and Description |
---|---|
boolean |
addIssue(IElementAccess element,
IPluginIssueId id,
java.lang.String description,
int line)
Add an issue to an element.
|
IGenericProgrammingElementAccess |
createProgrammingElement(INamedElementAccess parent,
IMetaClass metaClass,
java.lang.String name,
int line)
Create a new generic programming element.
|
IGenericProgrammingElementAccess |
createProgrammingElementComponent(INamedElementAccess parent,
IMetaClass metaClass,
java.lang.String name,
int line)
Create a new generic programming element that also is a component.
|
java.util.List<INamedElementAccess> |
findAllMatchingElements(INamedElementAccess searchRoot,
java.util.function.Predicate<INamedElementAccess> predicate)
Find all elements matching the predicate.
|
java.util.List<IFieldAccess> |
findAllMatchingFields(INamedElementAccess searchRoot,
java.util.function.Predicate<IFieldAccess> predicate)
Find all fields matching the predicate.
|
java.util.List<IMethodAccess> |
findAllMatchingMethods(INamedElementAccess searchRoot,
java.util.function.Predicate<IMethodAccess> predicate)
Find all methods matching the predicate.
|
java.util.List<IRoutineAccess> |
findAllMatchingRoutines(INamedElementAccess searchRoot,
java.util.function.Predicate<IRoutineAccess> predicate)
Find all routines matching the predicate.
|
java.util.List<ITypeAccess> |
findAllMatchingTypes(INamedElementAccess searchRoot,
java.util.function.Predicate<ITypeAccess> predicate)
Find all types matching the predicate.
|
IElementAccess |
findElementByFqn(java.lang.String fqn)
Find an element by its fully qualified name.
|
INamedElementAccess |
findFirstMatchingElement(INamedElementAccess parent,
java.util.function.Predicate<INamedElementAccess> predicate)
Find first child matching the predicate.
|
INamedElementAccess |
findFirstMatchingElementRecursively(INamedElementAccess searchRoot,
java.util.function.Predicate<INamedElementAccess> predicate)
Recursively find first element matching the predicate.
|
IFieldAccess |
findFirstMatchingField(INamedElementAccess searchRoot,
java.util.function.Predicate<IFieldAccess> predicate)
Find first field matching the predicate.
|
IMethodAccess |
findFirstMatchingMethod(INamedElementAccess searchRoot,
java.util.function.Predicate<IMethodAccess> predicate)
Find first method matching the predicate.
|
IRoutineAccess |
findFirstMatchingRoutine(INamedElementAccess searchRoot,
java.util.function.Predicate<IRoutineAccess> predicate)
Find first type routine the predicate.
|
ITypeAccess |
findFirstMatchingType(INamedElementAccess searchRoot,
java.util.function.Predicate<ITypeAccess> predicate)
Find first type matching the predicate.
|
java.lang.Float |
getACDMetric()
Get ACD (John Lakos) metric for system scope.
|
java.lang.Integer |
getBiggestComponentCycleGroupMetric()
Get number of elements in the biggest component cycle group of the system.
|
java.lang.Float |
getBiggestModuleACDMetric()
Get the biggest ACD value (John Lakos) of all modules in the system.
|
java.lang.Integer |
getCCDMetric()
Get CCD (John Lakos) metric for system scope.
|
java.lang.Integer |
getCodeCommentLinesMetric()
Get number of code comment lines on system scope.
|
java.lang.Integer |
getCommentLinesMetric()
Get number of comment lines including header comments.
|
java.lang.Integer |
getComponentCyclicityMetric()
Get system wide component cyclicity metric.
|
java.lang.Integer |
getComponentDependenciesToRemoveMetric()
Get number of component dependencies to remove to untangle all component cycle groups.
|
java.lang.Integer |
getComponentParserDependenciesToRemoveMetric()
Get number of references between components to remove to untangle all component cycle groups.
|
java.lang.Float |
getComponentRelativeCyclicityMetric()
Get system wide relative cyclicity between components.
|
java.util.List<IComponentAccess> |
getComponents()
Gets a list of all components of the software system
|
java.lang.Integer |
getComponentStructuralDebtIndexMetric()
Get system wide structural debt index on component level.
|
IExternalAccess |
getExternalRoot(java.lang.String forLanguage)
Get the external root node for a given language
|
java.io.File |
getHiddenDataDirectory(java.lang.String pluginId)
Get hidden data directory for a plugin.
|
java.lang.Integer |
getLinesOfCodeMetric()
Get lines of codes (excluding empty lines and comment lines) on system scope.
|
java.util.List<IModuleAccess> |
getModules()
Get a list of the modules in this system
|
java.lang.String |
getName()
Return name of software system
|
java.lang.Float |
getNCCDMetric()
Get NCCD metric for system scope (John Lakos).
|
java.lang.Integer |
getNumberOfCodeDuplicatesMetric()
Get total number of non-ignored duplicated code blocks on system scope.
|
java.lang.Integer |
getNumberOfComponentCycleGroupsMetric()
Get the number of component cycle groups on system scope.
|
java.lang.Integer |
getNumberOfComponentsMetric()
Get the number of internal components in the system.
|
java.lang.Integer |
getNumberOfComponentViolationsMetric()
Get number of architecture violations between components.
|
java.lang.Integer |
getNumberOfCyclicComponentsMetric()
Get the number of internal components involved in cyclic dependencies that are not ignored.
|
java.lang.Integer |
getNumberOfDuplicatedLinesMetric()
Get total number of duplicated lines in non-ignored duplicated code blocks on system scope.
|
java.lang.Integer |
getNumberOfIgnoredCodeDuplicatesMetric()
Get total number of ignored duplicated code blocks on system scope.
|
java.lang.Integer |
getNumberOfIgnoredCyclicComponentsMetric()
Get the number of internal components involved in ignored cyclic dependencies.
|
java.lang.Integer |
getNumberOfIgnoredParserDependencyViolationsMetric()
Get number of ignored violating parser dependencies.
|
java.lang.Integer |
getNumberOfParserDependencyViolationsMetric()
Get number of violating parser dependencies.
|
java.lang.Integer |
getNumberOfStatementsMetric()
Get the total number of statements on system scope.
|
java.lang.Integer |
getNumberOfUnassignedComponentsMetric()
Get number of component not assigned to any active architectural artifact.
|
java.lang.Integer |
getNumberOfViolatingComponentsMetric()
Get number of components containing architecture violations.
|
java.lang.Float |
getRACDMetric()
Get the value of RACD for the system scope (John Lakos).
|
java.lang.Integer |
getSourceElementCountMetric()
Get the total source element count of all internal elements of the system.
|
java.lang.Integer |
getTotalLinesMetric()
Get the total number of lines in the system, including empty and comment lines.
|
INamedElementAccess |
getWorkspaceRoot() |
void |
visitLogicalModuleNamespaces(ModelVisitor visitor)
Visit module level logical namespaces
|
void |
visitLogicalSystemNamespaces(ModelVisitor visitor)
Visit system level logical namespaces
|
void |
visitParserModel(ModelVisitor visitor)
Visit only the parser model
|
java.lang.String getName()
java.util.List<IComponentAccess> getComponents()
java.util.List<IModuleAccess> getModules()
IExternalAccess getExternalRoot(java.lang.String forLanguage)
forLanguage
- Language (as of now "Java", "C#" or "C/C++")IElementAccess findElementByFqn(java.lang.String fqn)
fqn
- The fully qualified name of the element (to be found in Sonargraphs properties view). Must not be null, empty or contain only
whitespace.java.lang.IllegalArgumentException
- If fqn is null, empty or contains only whitespace.java.lang.Float getACDMetric()
java.lang.Integer getBiggestComponentCycleGroupMetric()
java.lang.Integer getCCDMetric()
java.lang.Integer getCodeCommentLinesMetric()
java.lang.Integer getCommentLinesMetric()
java.lang.Integer getLinesOfCodeMetric()
java.lang.Float getNCCDMetric()
java.lang.Integer getNumberOfComponentCycleGroupsMetric()
java.lang.Integer getNumberOfComponentsMetric()
java.lang.Integer getNumberOfCyclicComponentsMetric()
java.lang.Integer getNumberOfIgnoredCyclicComponentsMetric()
java.lang.Integer getNumberOfStatementsMetric()
java.lang.Float getRACDMetric()
java.lang.Integer getSourceElementCountMetric()
java.lang.Integer getTotalLinesMetric()
java.lang.Integer getNumberOfCodeDuplicatesMetric()
java.lang.Integer getNumberOfDuplicatedLinesMetric()
java.lang.Integer getNumberOfIgnoredCodeDuplicatesMetric()
java.lang.Float getBiggestModuleACDMetric()
java.lang.Integer getComponentCyclicityMetric()
java.lang.Float getComponentRelativeCyclicityMetric()
java.lang.Integer getComponentStructuralDebtIndexMetric()
java.lang.Integer getComponentParserDependenciesToRemoveMetric()
java.lang.Integer getComponentDependenciesToRemoveMetric()
java.lang.Integer getNumberOfUnassignedComponentsMetric()
java.lang.Integer getNumberOfComponentViolationsMetric()
java.lang.Integer getNumberOfViolatingComponentsMetric()
java.lang.Integer getNumberOfParserDependencyViolationsMetric()
java.lang.Integer getNumberOfIgnoredParserDependencyViolationsMetric()
ITypeAccess findFirstMatchingType(INamedElementAccess searchRoot, java.util.function.Predicate<ITypeAccess> predicate)
searchRoot
- Element from where to begin the search or null if whole system is to be searched.predicate
- The predicate to match the type, must not be null.java.util.List<ITypeAccess> findAllMatchingTypes(INamedElementAccess searchRoot, java.util.function.Predicate<ITypeAccess> predicate)
searchRoot
- Element from where to begin the search or null if whole system is to be searched.predicate
- The predicate to match the types, must not be null.IMethodAccess findFirstMatchingMethod(INamedElementAccess searchRoot, java.util.function.Predicate<IMethodAccess> predicate)
searchRoot
- Element from where to begin the search, or null to use 'Workspace' as root.predicate
- The predicate to match the method, must not be null.java.util.List<IMethodAccess> findAllMatchingMethods(INamedElementAccess searchRoot, java.util.function.Predicate<IMethodAccess> predicate)
searchRoot
- Element from where to begin the search, or null to use 'Workspace' as root.predicate
- The predicate to match the methods, must not be null.IRoutineAccess findFirstMatchingRoutine(INamedElementAccess searchRoot, java.util.function.Predicate<IRoutineAccess> predicate)
searchRoot
- Element from where to begin the search, or null to use 'Workspace' as root.predicate
- The predicate to match the routine, must not be null.java.util.List<IRoutineAccess> findAllMatchingRoutines(INamedElementAccess searchRoot, java.util.function.Predicate<IRoutineAccess> predicate)
searchRoot
- Element from where to begin the search, or null to use 'Workspace' as root.predicate
- The predicate to match the routines, must not be null.IFieldAccess findFirstMatchingField(INamedElementAccess searchRoot, java.util.function.Predicate<IFieldAccess> predicate)
searchRoot
- Element from where to begin the search, or null to use 'Workspace' as root.predicate
- The predicate to match the field, must not be null.java.util.List<IFieldAccess> findAllMatchingFields(INamedElementAccess searchRoot, java.util.function.Predicate<IFieldAccess> predicate)
searchRoot
- Element from where to begin the search, or null to use 'Workspace' as root.predicate
- The predicate to match the fields, must not be null.INamedElementAccess findFirstMatchingElement(INamedElementAccess parent, java.util.function.Predicate<INamedElementAccess> predicate)
parent
- Parent element to search for a child, or null to use 'Workspace' as parent.predicate
- The predicate to match the element, must not be null.INamedElementAccess findFirstMatchingElementRecursively(INamedElementAccess searchRoot, java.util.function.Predicate<INamedElementAccess> predicate)
searchRoot
- Element from where to begin the search or null if whole system is to be searched.predicate
- The predicate to match the element, must not be null.java.util.List<INamedElementAccess> findAllMatchingElements(INamedElementAccess searchRoot, java.util.function.Predicate<INamedElementAccess> predicate)
searchRoot
- Element from where to begin the search, or null to use 'Workspace' as root.predicate
- The predicate to match the element, must not be null.INamedElementAccess getWorkspaceRoot()
void visitParserModel(ModelVisitor visitor)
visitor
- the visitorvoid visitLogicalModuleNamespaces(ModelVisitor visitor)
visitor
- the visitorvoid visitLogicalSystemNamespaces(ModelVisitor visitor)
visitor
- the visitorIGenericProgrammingElementAccess createProgrammingElement(INamedElementAccess parent, IMetaClass metaClass, java.lang.String name, int line)
parent
- The parent elementmetaClass
- Meta classname
- Element nameline
- Line number or -1 if unknownIGenericProgrammingElementAccess createProgrammingElementComponent(INamedElementAccess parent, IMetaClass metaClass, java.lang.String name, int line)
parent
- The parent elementmetaClass
- Meta classname
- Element nameline
- Line number or -1 if unknownboolean addIssue(IElementAccess element, IPluginIssueId id, java.lang.String description, int line)
element
- The element associated with the issueid
- Issue specific id, should be equal for all issues of the same kinddescription
- Issue description (can be null)line
- Line number or 0 or negative when unknownjava.io.File getHiddenDataDirectory(java.lang.String pluginId)
pluginId
- plugin id, must not be null or empty.