aws-samples / s3-object-lambda-workshop
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
pxd
txt
pyx
pxi
in
xsl
tpl
tab
ini
  • 24 extensions are included in analyses: py, h, pyi, pxd, txt, pyx, c, json, pxi, js, in, xsl, rst, md, tpl, tab, ini, hpp, toml, css, yml, html, cc, gitignore
  • 6 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 ".*/bin/.*" (Binaries for distribution) (1 file).
    • 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) (58 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.

main421542 LOC (98%) 1808 files
test2323 LOC (<1%) 15 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other3751 LOC (<1%) 43 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
pyx
pyi
pxd
pxi
in
xsl
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1808 files match defined criteria (421,542 lines of code, 100.0% vs. main code):
    • 1,045 *.py files (275,960 lines of code)
    • 447 *.h files (74,369 lines of code)
    • 57 *.pyx files (28,063 lines of code)
    • 95 *.pyi files (10,907 lines of code)
    • 47 *.c files (8,440 lines of code)
    • 61 *.pxd files (8,345 lines of code)
    • 18 *.pxi files (7,081 lines of code)
    • 8 *.in files (2,438 lines of code)
    • 7 *.xsl files (2,347 lines of code)
    • 2 *.hpp files (2,145 lines of code)
    • 11 *.js files (678 lines of code)
    • 1 *.cc files (298 lines of code)
    • 1 *.yml files (273 lines of code)
    • 4 *.tpl files (151 lines of code)
    • 1 *.css files (30 lines of code)
    • 1 *.html files (11 lines of code)
    • 2 *.toml files (6 lines of code)
  • " *.py" is biggest, containing 65.46% of code.
  • " *.toml" is smallest, containing 0% of code.


*.py275960 LOC (65%) 1045 files
*.h74369 LOC (17%) 447 files
*.pyx28063 LOC (6%) 57 files
*.pyi10907 LOC (2%) 95 files
*.c8440 LOC (2%) 47 files
*.pxd8345 LOC (1%) 61 files
*.pxi7081 LOC (1%) 18 files
*.in2438 LOC (<1%) 8 files
*.xsl2347 LOC (<1%) 7 files
*.hpp2145 LOC (<1%) 2 files
*.js678 LOC (<1%) 11 files
*.cc298 LOC (<1%) 1 files
*.yml273 LOC (<1%) 1 files
*.tpl151 LOC (<1%) 4 files
*.css30 LOC (<1%) 1 files
*.html11 LOC (<1%) 1 files
*.toml6 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 ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 15 files match defined criteria (2,323 lines of code, 0.6% vs. main code):
    • 12 *.h files (2,311 lines of code)
    • 1 *.py files (6 lines of code)
    • 1 *.js files (5 lines of code)
    • 1 *.c files (1 lines of code)
  • " *.h" is biggest, containing 99.48% of code.
  • " *.c" is smallest, containing 0.04% of code.


*.h2311 LOC (99%) 12 files
*.py6 LOC (<1%) 1 files
*.js5 LOC (<1%) 1 files
*.c1 LOC (<1%) 1 files
Other Code
tab
ini
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 ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]tab".
    • files with paths like ".*/COPYING[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
  • 43 files match defined criteria (3,751 lines of code, 0.9% vs. main code):
    • 28 *.json files (1,845 lines of code)
    • 3 *.tab files (1,108 lines of code)
    • 5 *.rst files (685 lines of code)
    • 5 *.md files (86 lines of code)
    • 2 *.ini files (27 lines of code)
  • " *.json" is biggest, containing 49.19% of code.
  • " *.ini" is smallest, containing 0.72% of code.


*.json1845 LOC (49%) 28 files
*.tab1108 LOC (29%) 3 files
*.rst685 LOC (18%) 5 files
*.md86 LOC (2%) 5 files
*.ini27 LOC (<1%) 2 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
  • *.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
  • *.pyx 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
  • *.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
  • *.pxd 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
  • *.pxi 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
  • *.in 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
  • *.xsl files are analyzed with XmlAnalyzer:
    • 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
  • *.hpp 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
  • *.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
  • *.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
  • *.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
  • *.tpl 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
  • *.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
  • *.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
  • *.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


2022-01-31 17:23