anthropics / claude-agent-sdk-demos
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
gitattributes
plist
editorconfig
ejs
eslintignore
  • 18 extensions are included in analyses: ts, tsx, md, json, js, py, txt, gitignore, css, sql, html, svg, gitattributes, plist, editorconfig, toml, ejs, eslintignore
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (3 files).
    • 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.

main15385 LOC (23%) 148 files
test192 LOC (<1%) 3 files
generated20166 LOC (31%) 4 files
build and deployment867 LOC (1%) 20 files
other28297 LOC (43%) 64 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ejs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 148 files match defined criteria (15,385 LOC, 100.0% vs. main code):
    • 77 *.ts files (9,539 LOC)
    • 38 *.tsx files (4,304 LOC)
    • 12 *.py files (821 LOC)
    • 3 *.css files (267 LOC)
    • 3 *.sql files (217 LOC)
    • 11 *.js files (186 LOC)
    • 3 *.html files (37 LOC)
    • 1 *.ejs files (14 LOC)
  • " *.ts" is biggest, containing 62% of LOC.
  • " *.ejs" is smallest, containing 0.09% of LOC.


*.ts9539 LOC (62%) 77 files
*.tsx4304 LOC (27%) 38 files
*.py821 LOC (5%) 12 files
*.css267 LOC (1%) 3 files
*.sql217 LOC (1%) 3 files
*.js186 LOC (1%) 11 files
*.html37 LOC (<1%) 3 files
*.ejs14 LOC (<1%) 1 file
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 ".*_test[.].*".
    • files with paths like ".*/mock[a-zA-Z0-9_\- ]+/.*".
    • files with paths like ".*/[Mm]ocks/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*__tests__.*".
  • 3 files match defined criteria (192 LOC, 1.2% vs. main code):
    • 1 *.py files (185 LOC)
    • 1 *.tsx files (6 LOC)
    • 1 *.js files (1 LOC)
  • " *.py" is biggest, containing 96.35% of LOC.
  • " *.js" is smallest, containing 0.52% of LOC.


*.py185 LOC (96%) 1 file
*.tsx6 LOC (3%) 1 file
*.js1 LOC (<1%) 1 file
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[-]lock[.]json".
  • 4 files match defined criteria (20,166 LOC, 131.1% vs. main code). All matches are in *.json files.


*.json20166 LOC (100%) 4 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
eslintignore
gitattributes
editorconfig
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/pyproject[.]toml".
    • files with paths like ".*/requirements[a-zA-Z0-9._-]*[.]txt".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like "(.*/)?[.]eslintignore".
    • files with paths like "(.*/)?[.]eslintrc([.].*)?".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]editorconfig".
    • files with paths like "(.*/)?[.]editorconfig".
  • 20 files match defined criteria (867 LOC, 5.6% vs. main code):
    • 9 *.ts files (545 LOC)
    • 6 *.gitignore files (225 LOC)
    • 1 *.js files (35 LOC)
    • 1 *.eslintignore files (26 LOC)
    • 1 *.toml files (14 LOC)
    • 1 *.gitattributes files (12 LOC)
    • 1 *.editorconfig files (10 LOC)
  • " *.ts" is biggest, containing 62.86% of LOC.
  • " *.editorconfig" is smallest, containing 1.15% of LOC.


*.ts545 LOC (62%) 9 files
*.gitignore225 LOC (25%) 6 files
*.js35 LOC (4%) 1 file
*.eslintignore26 LOC (2%) 1 file
*.toml14 LOC (1%) 1 file
*.gitattributes12 LOC (1%) 1 file
*.editorconfig10 LOC (1%) 1 file
Other Code
plist
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]svg".
  • 64 files match defined criteria (28,297 LOC, 183.9% vs. main code):
    • 19 *.json files (20,813 LOC)
    • 35 *.md files (6,849 LOC)
    • 8 *.txt files (604 LOC)
    • 1 *.svg files (23 LOC)
    • 1 *.plist files (8 LOC)
  • " *.json" is biggest, containing 73.55% of LOC.
  • " *.plist" is smallest, containing 0.03% of LOC.


*.json20813 LOC (73%) 19 files
*.md6849 LOC (24%) 35 files
*.txt604 LOC (2%) 8 files
*.svg23 LOC (<1%) 1 file
*.plist8 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.tsx files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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
  • *.css files are analyzed with CssAnalyzer:
    • 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)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.sql files are analyzed with SqlAnalyzer:
    • 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)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.ejs 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:46