microsoft / botbuilder-python
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
cfg
in
cmd
  • 14 extensions are included in analyses: py, json, txt, md, yaml, rst, cfg, yml, sh, ipynb, gitignore, in, cmd, html
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (10 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) (40 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.

main28033 LOC (40%) 473 files
test22704 LOC (32%) 288 files
generated521 LOC (<1%) 1 files
build and deployment0 LOC (0%) 0 files
other17766 LOC (25%) 127 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmd
cfg
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 473 files match defined criteria (28,033 lines of code, 100.0% vs. main code):
    • 458 *.py files (27,792 lines of code)
    • 3 *.yml files (192 lines of code)
    • 1 *.cmd files (28 lines of code)
    • 8 *.cfg files (16 lines of code)
    • 2 *.in files (4 lines of code)
    • 1 *.html files (1 lines of code)
  • " *.py" is biggest, containing 99.14% of code.
  • " *.html" is smallest, containing 0% of code.


*.py27792 LOC (99%) 458 files
*.yml192 LOC (<1%) 3 files
*.cmd28 LOC (<1%) 1 files
*.cfg16 LOC (<1%) 8 files
*.in4 LOC (<1%) 2 files
*.html1 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 288 files match defined criteria (22,704 lines of code, 81.0% vs. main code):
    • 261 *.py files (21,760 lines of code)
    • 20 *.yaml files (802 lines of code)
    • 2 *.yml files (62 lines of code)
    • 4 *.sh files (59 lines of code)
    • 1 *.cmd files (21 lines of code)
  • " *.py" is biggest, containing 95.84% of code.
  • " *.cmd" is smallest, containing 0.09% of code.


*.py21760 LOC (95%) 261 files
*.yaml802 LOC (3%) 20 files
*.yml62 LOC (<1%) 2 files
*.sh59 LOC (<1%) 4 files
*.cmd21 LOC (<1%) 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".
  • 1 file matches defined criteria (521 lines of code, 1.9% vs. main code). All matches are in *.json files.


*.json521 LOC (100%) 1 files
Other Code
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 ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 127 files match defined criteria (17,766 lines of code, 63.4% vs. main code):
    • 79 *.json files (14,715 lines of code)
    • 32 *.md files (1,276 lines of code)
    • 4 *.ipynb files (1,038 lines of code)
    • 12 *.rst files (737 lines of code)
  • " *.json" is biggest, containing 82.83% of code.
  • " *.rst" is smallest, containing 4.15% of code.


*.json14715 LOC (82%) 79 files
*.md1276 LOC (7%) 32 files
*.ipynb1038 LOC (5%) 4 files
*.rst737 LOC (4%) 12 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
  • *.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
  • *.cmd 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
  • *.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
  • *.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
  • *.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 15:33