anthropics / orjson
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
pyi
gitattributes
  • 12 extensions are included in analyses: json, rs, py, txt, yaml, toml, md, pyi, c, gitignore, h, gitattributes
  • 2 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).
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.

main20185 LOC (68%) 87 files
test6275 LOC (21%) 35 files
generated0 LOC (0%) 0 files
build and deployment1102 LOC (3%) 9 files
other2069 LOC (6%) 403 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
pyi
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 87 files match defined criteria (20,185 LOC, 100.0% vs. main code):
    • 74 *.rs files (8,745 LOC)
    • 1 *.c files (7,308 LOC)
    • 1 *.h files (3,969 LOC)
    • 8 *.py files (117 LOC)
    • 1 *.pyi files (33 LOC)
    • 2 *.toml files (13 LOC)
  • " *.rs" is biggest, containing 43.32% of LOC.
  • " *.toml" is smallest, containing 0.06% of LOC.


*.rs8745 LOC (43%) 74 files
*.c7308 LOC (36%) 1 file
*.h3969 LOC (19%) 1 file
*.py117 LOC (<1%) 8 files
*.pyi33 LOC (<1%) 1 file
*.toml13 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
  • 35 files match defined criteria (6,275 LOC, 31.1% vs. main code). All matches are in *.py files.


*.py6275 LOC (100%) 35 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
gitattributes
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/requirements[a-zA-Z0-9._-]*[.]txt".
    • files with paths like ".*/Cargo[.]toml".
    • files with paths like ".*/[.]github/workflows/.*[.]ya?ml".
    • files with paths like ".*/[.]github/actions/.*[.]ya?ml".
    • files with paths like ".*/action[.]ya?ml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/pyproject[.]toml".
  • 9 files match defined criteria (1,102 LOC, 5.5% vs. main code):
    • 5 *.yaml files (917 LOC)
    • 2 *.toml files (172 LOC)
    • 1 *.gitignore files (12 LOC)
    • 1 *.gitattributes files (1 LOC)
  • " *.yaml" is biggest, containing 83.21% of LOC.
  • " *.gitattributes" is smallest, containing 0.09% of LOC.


*.yaml917 LOC (83%) 5 files
*.toml172 LOC (15%) 2 files
*.gitignore12 LOC (1%) 1 file
*.gitattributes1 LOC (<1%) 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".
  • 403 files match defined criteria (2,069 LOC, 10.3% vs. main code):
    • 2 *.md files (1,581 LOC)
    • 396 *.json files (465 LOC)
    • 5 *.txt files (23 LOC)
  • " *.md" is biggest, containing 76.41% of LOC.
  • " *.txt" is smallest, containing 1.11% of LOC.


*.md1581 LOC (76%) 2 files
*.json465 LOC (22%) 396 files
*.txt23 LOC (1%) 5 files
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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.h 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
  • *.py files are analyzed with PythonAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.pyi files are analyzed with PythonAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.toml 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


2026-06-24 10:45