NexTropy — Code Quality Dashboard

Erosion Trend

Complexity Over Time

Codebase Size (SLOC)

Cognitive Entropy (Halstead Effort)

AI Analysis

## Code Quality Analysis

Critical Health Deterioration Pattern

The metrics reveal a significant degradation event around commit ead62b148eb9, followed by an incomplete recovery that leaves the codebase in a compromised state.

Key Findings

1. Erosion Ratio Crisis

  • Sharp deterioration: Erosion ratio spiked from 0.24 (healthy) to 0.33+ (concerning) between commits f21a82b41ace and fc593cef0258
  • Current state: Remains elevated at 0.18, indicating 18% of code mass is in high-complexity functions
  • Impact: This suggests major refactoring or feature additions without corresponding complexity management

2. Complexity Explosion in Key Functions

  • The getElementByType functions show extreme Halstead effort (112,745 and 43,928) with high difficulty scores (34.4 and 22.4)
  • Cyclomatic complexity of 27 in DynamicFieldView indicates a function that's likely untestable and unmaintainable
  • These metrics are consistent with AI-generated boilerplate that lacks human architectural oversight

3. Zero Test Coverage Across All Commits

  • test_to_code_ratio = 0 throughout the entire timeline
  • With 177K+ SLOC and no tests, this codebase is critically vulnerable to regression

4. AI Development Indicators

  • Consistent high-mass functions (640+ mass units) suggest large, monolithic AI-generated code blocks
  • Low comment density (4.4%) typical of AI code that lacks explanatory context
  • The DynamicFieldForm and DynamicFieldView naming patterns suggest template-driven generation

Immediate Actions Required

Priority 1: Emergency Complexity Remediation

  • Decompose the three highest-effort functions immediately
  • Set hard limits: CC ≤ 10, Halstead effort ≤ 10,000
  • Target the 27-CC function in DynamicFieldView first

Priority 2: Establish Test Foundation

  • Implement tests for the top 5 entropy functions before any further development
  • Mandate 60% coverage for all new code

Priority 3: AI Code Review Protocol

  • Institute mandatory human review for any function with effort > 5,000
  • Require architectural justification for functions exceeding 100 SLOC

Trend Prognosis

The codebase shows signs of technical debt acceleration typical of AI-assisted development without proper guardrails. The erosion ratio trajectory suggests that without intervention, complexity will continue growing faster than the overall codebase, making future maintenance exponentially more expensive.

Bottom line: This codebase is approaching a maintainability cliff. Address the complexity crisis now or face exponentially higher refactoring costs within 2-3 development cycles.

Latest Snapshot Summary

MetricValue
Erosion Ratio 18.2%
Total Functions 281
High-Mass Functions (CC > 10) 3
Total SLOC 177,086
Total Files 3059
Max CC 27
P90 CC 5.0
Avg CC 2.3
Comment Density 4.4%
Test-to-Code Ratio 0.00
Boilerplate Ratio 0.0%
Naming Consistency 0.0%
Error Handling Entropy 0.00

High-Mass Functions

FileFunctionCCSLOCMass
src/application/components/DynamicScreen/components/DynamicFieldView/DynamicFieldView.tsx getElementByType 27 126 303.1
src/application/components/DynamicScreen/components/DynamicFieldForm/DynamicFieldForm.tsx getElementByType 13 301 225.5
src/domain/media/reducers/attachmentReducer.ts attachmentReducer 11 103 111.6

Cognitive Entropy (Halstead)

FileFunctionEffortVolumeDifficultyCC
src/application/components/DynamicScreen/components/DynamicFieldForm/DynamicFieldForm.tsx getElementByType 112,745.8 3,281.4 34.4 13
src/domain/investments/utils/investmentsTreeViewItems.ts processInvestmentTreeView 48,098.1 2,409.0 20.0 10
src/application/components/DynamicScreen/components/DynamicFieldView/DynamicFieldView.tsx getElementByType 43,928.0 1,960.2 22.4 27
src/application/pages/claims/ClaimsEdition/ClaimsEdition.tsx ClaimsEdition 42,627.8 2,736.3 15.6 4
src/infrastructure/redux/clientState/NetworkService/sagas/NetworkSaga.ts networkRequestSaga 42,034.4 1,220.0 34.5 7
src/infrastructure/redux/clientState/TreeViewService/reducers/TreeViewReducer.ts treeViewItemsReducer 32,740.9 1,225.6 26.7 8
src/application/pages/claims/ClaimsCreation/ClaimsCreation.tsx ClaimsCreation 28,957.9 2,339.3 12.4 1
src/application/components/FeatureFlagPanel/FeatureFlagPanel.tsx FeatureFlagPanel 28,168.3 1,609.6 17.5 8
src/domain/media/reducers/attachmentReducer.ts attachmentReducer 24,192.0 960.0 25.2 11
src/domain/agents/utils/agentContractAgreementFormUtils.ts buildGqlUpdateAgreement 20,969.0 1,352.8 15.5 7