microsoft / vision-ai-developer-kit
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
pb
dockerignore
in
cfg
ejs
  • 18 extensions are included in analyses: py, json, js, txt, md, html, ipynb, css, gitignore, sh, pb, yml, dockerignore, bat, in, cfg, ps1, ejs
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (22 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (1 file).
    • exclude files with path like ".*/underscore\.js" (Underscore.js) (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 ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (34 files).
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.

main9945 LOC (20%) 45 files
test361 LOC (<1%) 8 files
generated12140 LOC (24%) 3 files
build and deployment4 LOC (<1%) 1 files
other26679 LOC (54%) 185 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 45 files match defined criteria (9,945 lines of code, 100.0% vs. main code):
    • 18 *.html files (5,714 lines of code)
    • 13 *.py files (1,788 lines of code)
    • 5 *.js files (1,539 lines of code)
    • 3 *.css files (829 lines of code)
    • 1 *.ps1 files (30 lines of code)
    • 1 *.in files (27 lines of code)
    • 3 *.yml files (16 lines of code)
    • 1 *.cfg files (2 lines of code)
  • " *.html" is biggest, containing 57.46% of code.
  • " *.cfg" is smallest, containing 0.02% of code.


*.html5714 LOC (57%) 18 files
*.py1788 LOC (17%) 13 files
*.js1539 LOC (15%) 5 files
*.css829 LOC (8%) 3 files
*.ps130 LOC (<1%) 1 files
*.in27 LOC (<1%) 1 files
*.yml16 LOC (<1%) 3 files
*.cfg2 LOC (<1%) 1 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 any line of content like ".*/simpletest/.*".
  • 8 files match defined criteria (361 lines of code, 3.6% vs. main code):
    • 6 *.py files (317 lines of code)
    • 1 *.bat files (35 lines of code)
    • 1 *.sh files (9 lines of code)
  • " *.py" is biggest, containing 87.81% of code.
  • " *.sh" is smallest, containing 2.49% of code.


*.py317 LOC (87%) 6 files
*.bat35 LOC (9%) 1 files
*.sh9 LOC (2%) 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 ".*/package[-]lock[.]json".
  • 3 files match defined criteria (12,140 lines of code, 122.1% vs. main code). All matches are in *.json files.


*.json12140 LOC (100%) 3 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".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 1 file matches defined criteria (4 lines of code, 0.0% vs. main code). All matches are in *.sh files.


*.sh4 LOC (100%) 1 files
Other Code
in
ejs
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 185 files match defined criteria (26,679 lines of code, 268.3% vs. main code):
    • 55 *.json files (15,169 lines of code)
    • 60 *.py files (5,449 lines of code)
    • 24 *.js files (2,510 lines of code)
    • 4 *.ipynb files (1,950 lines of code)
    • 21 *.md files (770 lines of code)
    • 10 *.css files (674 lines of code)
    • 5 *.sh files (69 lines of code)
    • 1 *.bat files (35 lines of code)
    • 1 *.in files (27 lines of code)
    • 1 *.html files (15 lines of code)
    • 1 *.yml files (6 lines of code)
    • 1 *.ejs files (3 lines of code)
    • 1 *.cfg files (2 lines of code)
  • " *.json" is biggest, containing 56.86% of code.
  • " *.cfg" is smallest, containing 0.01% of code.


*.json15169 LOC (56%) 55 files
*.py5449 LOC (20%) 60 files
*.js2510 LOC (9%) 24 files
*.ipynb1950 LOC (7%) 4 files
*.md770 LOC (2%) 21 files
*.css674 LOC (2%) 10 files
*.sh69 LOC (<1%) 5 files
*.bat35 LOC (<1%) 1 files
*.in27 LOC (<1%) 1 files
*.html15 LOC (<1%) 1 files
*.yml6 LOC (<1%) 1 files
*.ejs3 LOC (<1%) 1 files
*.cfg2 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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-30 23:54