microsoft / nni
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
gitattributes
patch
ini
eslintignore
  • 22 extensions are included in analyses: py, rst, yml, ts, json, md, tsx, txt, scss, yaml, sh, gitignore, js, ipynb, svg, css, html, gitattributes, patch, ini, Dockerfile, eslintignore
  • 10 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (28 files).
    • exclude files with path like ".*/dependencies/.*" (Dependencies) (7 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (352 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (4 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 ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (20 files).
    • exclude files with path like ".*/static/js/.*" (JS library) (0 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.

main66104 LOC (50%) 663 files
test17630 LOC (13%) 237 files
generated0 LOC (0%) 0 files
build and deployment474 LOC (<1%) 2 files
other46292 LOC (35%) 561 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 ".*".
  • 663 files match defined criteria (66,104 lines of code, 100.0% vs. main code):
    • 436 *.py files (40,781 lines of code)
    • 120 *.ts files (16,318 lines of code)
    • 55 *.tsx files (6,083 lines of code)
    • 28 *.scss files (1,415 lines of code)
    • 12 *.js files (737 lines of code)
    • 9 *.yml files (579 lines of code)
    • 2 *.css files (176 lines of code)
    • 1 *.html files (15 lines of code)
  • " *.py" is biggest, containing 61.69% of code.
  • " *.html" is smallest, containing 0.02% of code.


*.py40781 LOC (61%) 436 files
*.ts16318 LOC (24%) 120 files
*.tsx6083 LOC (9%) 55 files
*.scss1415 LOC (2%) 28 files
*.js737 LOC (1%) 12 files
*.yml579 LOC (<1%) 9 files
*.css176 LOC (<1%) 2 files
*.html15 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 ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 237 files match defined criteria (17,630 lines of code, 26.7% vs. main code):
    • 136 *.py files (12,393 lines of code)
    • 28 *.ts files (2,837 lines of code)
    • 64 *.yml files (2,281 lines of code)
    • 3 *.sh files (62 lines of code)
    • 3 *.yaml files (50 lines of code)
    • 1 *.html files (4 lines of code)
    • 2 *.js files (3 lines of code)
  • " *.py" is biggest, containing 70.29% of code.
  • " *.js" is smallest, containing 0.02% of code.


*.py12393 LOC (70%) 136 files
*.ts2837 LOC (16%) 28 files
*.yml2281 LOC (12%) 64 files
*.sh62 LOC (<1%) 3 files
*.yaml50 LOC (<1%) 3 files
*.html4 LOC (<1%) 1 files
*.js3 LOC (<1%) 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 2 files match defined criteria (474 lines of code, 0.7% vs. main code). All matches are in *.js files.


*.js474 LOC (100%) 2 files
Other Code
patch
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 561 files match defined criteria (46,292 lines of code, 70.0% vs. main code):
    • 263 *.py files (28,739 lines of code)
    • 96 *.json files (9,943 lines of code)
    • 5 *.ipynb files (2,789 lines of code)
    • 113 *.yml files (2,118 lines of code)
    • 48 *.md files (1,654 lines of code)
    • 17 *.yaml files (672 lines of code)
    • 16 *.sh files (294 lines of code)
    • 1 *.patch files (76 lines of code)
    • 1 *.dockerfile files (5 lines of code)
    • 1 *.ini files (2 lines of code)
  • " *.py" is biggest, containing 62.08% of code.
  • " *.ini" is smallest, containing 0% of code.


*.py28739 LOC (62%) 263 files
*.json9943 LOC (21%) 96 files
*.ipynb2789 LOC (6%) 5 files
*.yml2118 LOC (4%) 113 files
*.md1654 LOC (3%) 48 files
*.yaml672 LOC (1%) 17 files
*.sh294 LOC (<1%) 16 files
*.patch76 LOC (<1%) 1 files
*.dockerfile5 LOC (<1%) 1 files
*.ini2 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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.tsx files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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-30 20:09