awslabs / aws-virtual-application-management
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
babelrc
snap
prettierignore
eslintignore
txt
ini
  • 20 extensions are included in analyses: js, json, ts, md, yml, gitignore, babelrc, snap, prettierignore, sh, eslintignore, xml, ps1, css, yaml, svg, txt, ini, html, bash
  • 11 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (173 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 ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (474 files).
    • exclude files with path like ".*/[Pp]ackages\/.+\.\d+\/.*" (NuGet) (9 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (1 file).
    • exclude files with path like ".*/target/.*" (Compiled files) (4 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (198 files).
    • exclude files with path like ".*[.]txt" (Text files) (2 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (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.

main80393 LOC (68%) 1118 files
test25213 LOC (21%) 385 files
generated0 LOC (0%) 0 files
build and deployment1069 LOC (<1%) 26 files
other11169 LOC (9%) 355 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 ".*".
  • 1118 files match defined criteria (80,393 lines of code, 100.0% vs. main code):
    • 1,012 *.js files (45,858 lines of code)
    • 4 *.yaml files (27,407 lines of code)
    • 94 *.yml files (6,421 lines of code)
    • 2 *.css files (616 lines of code)
    • 4 *.ps1 files (38 lines of code)
    • 1 *.bash files (37 lines of code)
    • 1 *.html files (16 lines of code)
  • " *.js" is biggest, containing 57.04% of code.
  • " *.html" is smallest, containing 0.02% of code.


*.js45858 LOC (57%) 1012 files
*.yaml27407 LOC (34%) 4 files
*.yml6421 LOC (7%) 94 files
*.css616 LOC (<1%) 2 files
*.ps138 LOC (<1%) 4 files
*.bash37 LOC (<1%) 1 files
*.html16 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
snap
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*__test__.*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*/__mocks?__/.*".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*[.]tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 385 files match defined criteria (25,213 lines of code, 31.4% vs. main code):
    • 314 *.js files (22,561 lines of code)
    • 65 *.snap files (2,525 lines of code)
    • 6 *.yml files (127 lines of code)
  • " *.js" is biggest, containing 89.48% of code.
  • " *.yml" is smallest, containing 0.5% of code.


*.js22561 LOC (89%) 314 files
*.snap2525 LOC (10%) 65 files
*.yml127 LOC (<1%) 6 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 ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 26 files match defined criteria (1,069 lines of code, 1.3% vs. main code):
    • 10 *.js files (626 lines of code)
    • 16 *.sh files (443 lines of code)
  • " *.js" is biggest, containing 58.56% of code.
  • " *.sh" is smallest, containing 41.44% of code.


*.js626 LOC (58%) 10 files
*.sh443 LOC (41%) 16 files
Other Code
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 ".*/[.]gitignore".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 355 files match defined criteria (11,169 lines of code, 13.9% vs. main code):
    • 240 *.json files (7,881 lines of code)
    • 104 *.md files (3,175 lines of code)
    • 5 *.xml files (86 lines of code)
    • 3 *.yml files (18 lines of code)
    • 2 *.ini files (5 lines of code)
    • 1 *.js files (4 lines of code)
  • " *.json" is biggest, containing 70.56% of code.
  • " *.js" is smallest, containing 0.04% of code.


*.json7881 LOC (70%) 240 files
*.md3175 LOC (28%) 104 files
*.xml86 LOC (<1%) 5 files
*.yml18 LOC (<1%) 3 files
*.ini5 LOC (<1%) 2 files
*.js4 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.yaml 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
  • *.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
  • *.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
  • *.ps1 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
  • *.bash files are analyzed with ShellAnalyzer:
    • 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


2022-01-31 22:41