microsoft / recommenders
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
in
ini
properties
  • 17 extensions are included in analyses: py, ipynb, md, yml, yaml, rst, scala, sbt, toml, txt, json, cpp, in, ini, gitignore, sh, properties
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (17 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (8 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) (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.

main17229 LOC (29%) 155 files
test8435 LOC (14%) 96 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other33180 LOC (56%) 100 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 155 files match defined criteria (17,229 lines of code, 100.0% vs. main code):
    • 130 *.py files (16,063 lines of code)
    • 15 *.yaml files (768 lines of code)
    • 1 *.cpp files (153 lines of code)
    • 4 *.scala files (146 lines of code)
    • 2 *.sbt files (79 lines of code)
    • 2 *.toml files (19 lines of code)
    • 1 *.in files (1 lines of code)
  • " *.py" is biggest, containing 93.23% of code.
  • " *.in" is smallest, containing 0.01% of code.


*.py16063 LOC (93%) 130 files
*.yaml768 LOC (4%) 15 files
*.cpp153 LOC (<1%) 1 files
*.scala146 LOC (<1%) 4 files
*.sbt79 LOC (<1%) 2 files
*.toml19 LOC (<1%) 2 files
*.in1 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 ".*[-]tests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 96 files match defined criteria (8,435 lines of code, 49.0% vs. main code):
    • 66 *.py files (6,881 lines of code)
    • 27 *.yml files (1,420 lines of code)
    • 2 *.yaml files (70 lines of code)
    • 1 *.scala files (64 lines of code)
  • " *.py" is biggest, containing 81.58% of code.
  • " *.scala" is smallest, containing 0.76% of code.


*.py6881 LOC (81%) 66 files
*.yml1420 LOC (16%) 27 files
*.yaml70 LOC (<1%) 2 files
*.scala64 LOC (<1%) 1 files
Other Code
ini
properties
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • 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)".
  • 100 files match defined criteria (33,180 lines of code, 192.6% vs. main code):
    • 38 *.ipynb files (28,116 lines of code)
    • 19 *.py files (3,214 lines of code)
    • 36 *.md files (1,630 lines of code)
    • 4 *.yaml files (123 lines of code)
    • 1 *.ini files (84 lines of code)
    • 1 *.sh files (12 lines of code)
    • 1 *.properties files (1 lines of code)
  • " *.ipynb" is biggest, containing 84.74% of code.
  • " *.properties" is smallest, containing 0% of code.


*.ipynb28116 LOC (84%) 38 files
*.py3214 LOC (9%) 19 files
*.md1630 LOC (4%) 36 files
*.yaml123 LOC (<1%) 4 files
*.ini84 LOC (<1%) 1 files
*.sh12 LOC (<1%) 1 files
*.properties1 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
  • *.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
  • *.cpp files are analyzed with CppAnalyzer:
    • 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
  • *.scala files are analyzed with ScalaAnalyzer:
    • 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
  • *.sbt files are analyzed with ScalaAnalyzer:
    • 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
  • *.toml 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


2022-01-30 22:13