microsoft / MLOps
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
cmd
dbc
gitmodules
  • 15 extensions are included in analyses: py, json, md, yml, ipynb, sh, txt, gitignore, yaml, gitattributes, cmd, dbc, ps1, MD, gitmodules
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (12 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (3 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) (9 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.

main271 LOC (1%) 15 files
test0 LOC (0%) 0 files
generated0 LOC (0%) 0 files
build and deployment4 LOC (<1%) 3 files
other15688 LOC (98%) 189 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 ".*".
  • 15 files match defined criteria (271 lines of code, 100.0% vs. main code):
    • 9 *.yml files (171 lines of code)
    • 3 *.py files (55 lines of code)
    • 1 *.ps1 files (32 lines of code)
    • 1 *.yaml files (12 lines of code)
    • 1 *.md files (1 lines of code)
  • " *.yml" is biggest, containing 63.1% of code.
  • " *.md" is smallest, containing 0.37% of code.


*.yml171 LOC (63%) 9 files
*.py55 LOC (20%) 3 files
*.ps132 LOC (11%) 1 files
*.yaml12 LOC (4%) 1 files
*.md1 LOC (<1%) 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*[.]sh".
  • 3 files match defined criteria (4 lines of code, 1.5% vs. main code). All matches are in *.sh files.


*.sh4 LOC (100%) 3 files
Other Code
dbc
cmd
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 ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 189 files match defined criteria (15,688 lines of code, 5788.9% vs. main code):
    • 17 *.ipynb files (6,803 lines of code)
    • 61 *.py files (3,791 lines of code)
    • 39 *.json files (2,036 lines of code)
    • 33 *.md files (1,372 lines of code)
    • 14 *.sh files (608 lines of code)
    • 1 *.dbc files (535 lines of code)
    • 2 *.yaml files (299 lines of code)
    • 20 *.yml files (235 lines of code)
    • 2 *.cmd files (9 lines of code)
  • " *.ipynb" is biggest, containing 43.36% of code.
  • " *.cmd" is smallest, containing 0.06% of code.


*.ipynb6803 LOC (43%) 17 files
*.py3791 LOC (24%) 61 files
*.json2036 LOC (12%) 39 files
*.md1372 LOC (8%) 33 files
*.sh608 LOC (3%) 14 files
*.dbc535 LOC (3%) 1 files
*.yaml299 LOC (1%) 2 files
*.yml235 LOC (1%) 20 files
*.cmd9 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.md 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 01:12