anthropics / cargo-nix-plugin
Source Code Overview

Analysis scope, overview of main, test, generated, deployment, build, and other code.

Source Code Analysis Scope
Files includes and excluded from analyses
nix
  • 10 extensions are included in analyses: rs, toml, nix, md, json, txt, yaml, cc, gitignore, py
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (1 file).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (0 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (8 files).
Overview of Analyzed Files
Basic stats on analyzed files
Intro
For analysis purposes we separate files in scope into several categories: main, test, generated, deployment and build, and other.

  • The main category contains all manually created source code files that are being used in the production.
  • Files in the main category are used as input for other analyses: logical decomposition, concerns, duplication, file size, unit size, and conditional complexity.
  • Test source code files are used only for testing of the product. These files are normally not deployed to production.
  • Build and deployment source code files are used to configure or support build and deployment process.
  • Generated source code files are automatically generated files that have not been manually changed after generation.
  • While a source code folder may contain a number of files, we are primarily interested in the source code files that are being written and maintained by developers.
  • Files containing binaries, documentation, or third-party libraries, for instance, are excluded from analysis. The exception are third-party libraries that have been changed by developers.

main8424 LOC (50%) 26 files
test3926 LOC (23%) 48 files
generated0 LOC (0%) 0 files
build and deployment101 LOC (<1%) 5 files
other4335 LOC (25%) 7 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
nix
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 26 files match defined criteria (8,424 LOC, 100.0% vs. main code):
    • 18 *.rs files (6,893 LOC)
    • 7 *.nix files (1,439 LOC)
    • 1 *.cc files (92 LOC)
  • " *.rs" is biggest, containing 81.83% of LOC.
  • " *.cc" is smallest, containing 1.09% of LOC.


*.rs6893 LOC (81%) 18 files
*.nix1439 LOC (17%) 7 files
*.cc92 LOC (1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
nix
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
  • 48 files match defined criteria (3,926 LOC, 46.6% vs. main code):
    • 11 *.nix files (3,645 LOC)
    • 19 *.toml files (148 LOC)
    • 1 *.py files (79 LOC)
    • 17 *.rs files (54 LOC)
  • " *.nix" is biggest, containing 92.84% of LOC.
  • " *.rs" is smallest, containing 1.38% of LOC.


*.nix3645 LOC (92%) 11 files
*.toml148 LOC (3%) 19 files
*.py79 LOC (2%) 1 file
*.rs54 LOC (1%) 17 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/CMakeLists[.]txt".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/Cargo[.]toml".
    • files with paths like ".*/[.]github/workflows/.*[.]ya?ml".
  • 5 files match defined criteria (101 LOC, 1.2% vs. main code):
    • 2 *.yaml files (53 LOC)
    • 2 *.toml files (42 LOC)
    • 1 *.gitignore files (6 LOC)
  • " *.yaml" is biggest, containing 52.48% of LOC.
  • " *.gitignore" is smallest, containing 5.94% of LOC.


*.yaml53 LOC (52%) 2 files
*.toml42 LOC (41%) 2 files
*.gitignore6 LOC (5%) 1 file
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
  • 7 files match defined criteria (4,335 LOC, 51.5% vs. main code):
    • 2 *.json files (3,832 LOC)
    • 4 *.md files (448 LOC)
    • 1 *.txt files (55 LOC)
  • " *.json" is biggest, containing 88.4% of LOC.
  • " *.txt" is smallest, containing 1.27% of LOC.


*.json3832 LOC (88%) 2 files
*.md448 LOC (10%) 4 files
*.txt55 LOC (1%) 1 file
Analyzers
Info about analyzers used for source code examinations.
  • *.rs files are analyzed with RustAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.nix files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.cc files are analyzed with CppAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis


2026-06-24 10:49