Metrics Ontology 1.0
Cross-cutting code quality metrics combining AST, LSP, and external data sources.
Datatype Properties (14)
| Property | Domain | Range | Description |
|---|---|---|---|
| metrics:changeFrequency | ast:Node | xsd:nonNegativeInteger | Number of times this entity has been modified in git history. High churn may indicate instability or complexity. NOT YET IMPLEMENTED. To implement: Query git log for commits touching this file, filter... |
| metrics:couplingCount | ast:Node | xsd:nonNegativeInteger | Number of distinct external classes/modules this entity depends on. High coupling indicates tight dependencies and reduced modularity. NOT YET IMPLEMENTED. To implement: For each function/class, trave... |
| metrics:hasCircularDependency | ast:Node | xsd:boolean | Whether this module is part of a circular import dependency. Code smell indicator. NOT YET IMPLEMENTED. To implement: Build module dependency graph from lsp-x:importTarget resolution. Run cycle detect... |
| metrics:hasHighCoupling | ast:Node | xsd:boolean | Whether this class/module has excessive external dependencies (couplingCount > threshold). Code smell indicator. NOT YET IMPLEMENTED. To implement: Query for entities where metrics:couplingCount > thr... |
| metrics:impactRadius | ast:Node | xsd:nonNegativeInteger | Number of entities that transitively depend on this entity. High impact radius means changes affect many other parts of the codebase. NOT YET IMPLEMENTED. To implement: Build dependency graph from lsp... |
| metrics:isComplexFunction | ast:Node | xsd:boolean | Whether this function is too complex (cyclomatic complexity > 10). Code smell indicator. NOT YET IMPLEMENTED. To implement: Query for functions where ast-x:cyclomaticComplexity > 10. Threshold configu... |
| metrics:isGodClass | ast:Node | xsd:boolean | Whether this class has too many responsibilities (methods > 20 OR fields > 15). Code smell indicator. NOT YET IMPLEMENTED. To implement: Query for classes where ast-x:methodCount > 20 OR ast-x:fieldCo... |
| metrics:isLongFunction | ast:Node | xsd:boolean | Whether this function is too long (line count > 100). Code smell indicator. NOT YET IMPLEMENTED. To implement: Query for functions where ast-x:lineCount > 100. Threshold configurable (common values: 5... |
| metrics:isPublicAPI | ast:Node | xsd:boolean | Whether this symbol is part of the public API (exported/public). Used to distinguish internal code (safe to delete if unused) from external-facing code (breaking change risk). NOT YET IMPLEMENTED. To ... |
| metrics:isReachable | ast:Node | xsd:boolean | Whether this code is reachable from entry points. Used for dead code elimination. NOT YET IMPLEMENTED. To implement: (1) Identify entry points (main(), if __name__ == '__main__', @Test annotations, mo... |
| metrics:isUsed | ast:Node | xsd:boolean | Whether this variable/import/symbol is actually referenced. Used for unused code detection. NOT YET IMPLEMENTED. To implement: For imports, check if lsp-x:importTarget symbol appears in any identifier... |
| metrics:lintViolationCount | ast:Node | xsd:nonNegativeInteger | Number of linter violations in this entity. Used for code quality assessment. NOT YET IMPLEMENTED. To implement: Run language-specific linter (pylint, eslint, clippy, etc.), parse output (JSON format)... |
| metrics:securityVulnerabilityCount | ast:Node | xsd:nonNegativeInteger | Number of security vulnerabilities detected in this entity. Used for security assessment. NOT YET IMPLEMENTED. To implement: Run security scanner (bandit, semgrep, CodeQL, etc.), parse findings, map t... |
| metrics:testCoverage | ast:Node | xsd:decimal | Code coverage percentage for this function/class from test execution. Used to find untested code. NOT YET IMPLEMENTED. To implement: (1) Run coverage tool (coverage.py for Python, istanbul/nyc for JS,... |