aws / aws-neuron-sdk
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
proto
patch
  • 16 extensions are included in analyses: rst, py, ipynb, sh, md, txt, yml, json, cpp, proto, patch, xml, html, gitignore, h, hpp
  • 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) (8 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.

main2685 LOC (5%) 19 files
test0 LOC (0%) 0 files
generated120 LOC (<1%) 1 files
build and deployment43 LOC (<1%) 2 files
other45917 LOC (94%) 350 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 19 files match defined criteria (2,685 lines of code, 100.0% vs. main code):
    • 12 *.py files (2,309 lines of code)
    • 5 *.yml files (357 lines of code)
    • 1 *.proto files (18 lines of code)
    • 1 *.html files (1 lines of code)
  • " *.py" is biggest, containing 86% of code.
  • " *.html" is smallest, containing 0.04% of code.


*.py2309 LOC (85%) 12 files
*.yml357 LOC (13%) 5 files
*.proto18 LOC (<1%) 1 files
*.html1 LOC (<1%) 1 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 ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
  • 1 file matches defined criteria (120 lines of code, 4.5% vs. main code). All matches are in *.py files.


*.py120 LOC (100%) 1 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 2 files match defined criteria (43 lines of code, 1.6% vs. main code). All matches are in *.sh files.


*.sh43 LOC (100%) 2 files
Other Code
patch
proto
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 ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 350 files match defined criteria (45,917 lines of code, 1710.1% vs. main code):
    • 269 *.rst files (21,695 lines of code)
    • 3 *.json files (9,334 lines of code)
    • 17 *.ipynb files (8,741 lines of code)
    • 34 *.py files (4,023 lines of code)
    • 1 *.xml files (852 lines of code)
    • 9 *.md files (707 lines of code)
    • 3 *.cpp files (254 lines of code)
    • 9 *.sh files (133 lines of code)
    • 1 *.yml files (83 lines of code)
    • 1 *.patch files (63 lines of code)
    • 1 *.proto files (18 lines of code)
    • 1 *.h files (7 lines of code)
    • 1 *.hpp files (7 lines of code)
  • " *.rst" is biggest, containing 47.25% of code.
  • " *.hpp" is smallest, containing 0.02% of code.


*.rst21695 LOC (47%) 269 files
*.json9334 LOC (20%) 3 files
*.ipynb8741 LOC (19%) 17 files
*.py4023 LOC (8%) 34 files
*.xml852 LOC (1%) 1 files
*.md707 LOC (1%) 9 files
*.cpp254 LOC (<1%) 3 files
*.sh133 LOC (<1%) 9 files
*.yml83 LOC (<1%) 1 files
*.patch63 LOC (<1%) 1 files
*.proto18 LOC (<1%) 1 files
*.h7 LOC (<1%) 1 files
*.hpp7 LOC (<1%) 1 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
  • *.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
  • *.proto 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
  • *.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


2022-01-31 15:11