aws-samples / busy-engineers-document-bucket
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
txt
ini
npmignore
project
  • 18 extensions are included in analyses: java, ts, py, js, json, txt, xml, md, gitignore, toml, rst, yml, ini, npmignore, css, project, sh, html
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (18 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (9 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).
    • exclude files with path like ".*/docs/.*" (Documentation) (10 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 files).
    • exclude files with path like ".*[.]txt" (Text files) (18 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
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.

main7594 LOC (9%) 228 files
test3623 LOC (4%) 36 files
generated31263 LOC (40%) 14 files
build and deployment0 LOC (0%) 0 files
other35416 LOC (45%) 82 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 228 files match defined criteria (7,594 lines of code, 100.0% vs. main code):
    • 78 *.java files (3,015 lines of code)
    • 36 *.py files (1,630 lines of code)
    • 49 *.ts files (1,245 lines of code)
    • 44 *.js files (1,238 lines of code)
    • 13 *.toml files (348 lines of code)
    • 8 *.yml files (118 lines of code)
  • " *.java" is biggest, containing 39.7% of code.
  • " *.yml" is smallest, containing 1.55% of code.


*.java3015 LOC (39%) 78 files
*.py1630 LOC (21%) 36 files
*.ts1245 LOC (16%) 49 files
*.js1238 LOC (16%) 44 files
*.toml348 LOC (4%) 13 files
*.yml118 LOC (1%) 8 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_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 36 files match defined criteria (3,623 lines of code, 47.7% vs. main code):
    • 24 *.java files (1,884 lines of code)
    • 12 *.py files (1,739 lines of code)
  • " *.java" is biggest, containing 52% of code.
  • " *.py" is smallest, containing 48% of code.


*.java1884 LOC (52%) 24 files
*.py1739 LOC (47%) 12 files
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".
  • 14 files match defined criteria (31,263 lines of code, 411.7% vs. main code). All matches are in *.json files.


*.json31263 LOC (100%) 14 files
Other Code
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 82 files match defined criteria (35,416 lines of code, 466.4% vs. main code):
    • 38 *.json files (31,853 lines of code)
    • 18 *.xml files (2,958 lines of code)
    • 12 *.rst files (264 lines of code)
    • 6 *.ini files (210 lines of code)
    • 8 *.md files (131 lines of code)
  • " *.json" is biggest, containing 89.94% of code.
  • " *.md" is smallest, containing 0.37% of code.


*.json31853 LOC (89%) 38 files
*.xml2958 LOC (8%) 18 files
*.rst264 LOC (<1%) 12 files
*.ini210 LOC (<1%) 6 files
*.md131 LOC (<1%) 8 files
Analyzers
Info about analyzers used for source code examinations.
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.yml files are analyzed with YamlAnalyzer:
    • 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


2022-01-31 16:00