amazon-research / embert
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
l
txt
y
  • 11 extensions are included in analyses: json, py, jsonnet, c, h, sh, md, l, txt, y, gitignore
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (2 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 ".*[.]txt" (Text files) (1 file).
    • 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.

main36633 LOC (69%) 127 files
test631 LOC (1%) 8 files
generated0 LOC (0%) 0 files
build and deployment53 LOC (<1%) 8 files
other15215 LOC (28%) 251 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
y
l
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 127 files match defined criteria (36,633 lines of code, 100.0% vs. main code):
    • 89 *.py files (17,364 lines of code)
    • 11 *.c files (15,168 lines of code)
    • 2 *.y files (1,709 lines of code)
    • 12 *.jsonnet files (1,263 lines of code)
    • 11 *.h files (948 lines of code)
    • 2 *.l files (181 lines of code)
  • " *.py" is biggest, containing 47.4% of code.
  • " *.l" is smallest, containing 0.49% of code.


*.py17364 LOC (47%) 89 files
*.c15168 LOC (41%) 11 files
*.y1709 LOC (4%) 2 files
*.jsonnet1263 LOC (3%) 12 files
*.h948 LOC (2%) 11 files
*.l181 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]ests/.*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 8 files match defined criteria (631 lines of code, 1.7% vs. main code):
    • 6 *.jsonnet files (515 lines of code)
    • 2 *.py files (116 lines of code)
  • " *.jsonnet" is biggest, containing 81.62% of code.
  • " *.py" is smallest, containing 18.38% of code.


*.jsonnet515 LOC (81%) 6 files
*.py116 LOC (18%) 2 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 8 files match defined criteria (53 lines of code, 0.1% vs. main code). All matches are in *.sh files.


*.sh53 LOC (100%) 8 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
  • 251 files match defined criteria (15,215 lines of code, 41.5% vs. main code):
    • 246 *.json files (14,976 lines of code)
    • 5 *.md files (239 lines of code)
  • " *.json" is biggest, containing 98.43% of code.
  • " *.md" is smallest, containing 1.57% of code.


*.json14976 LOC (98%) 246 files
*.md239 LOC (1%) 5 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.y 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
  • *.jsonnet 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
  • *.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
  • *.l 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


2022-01-31 23:16