microsoft / botframework-sdk
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
g4
csproj
editorconfig
txt
gitattributes
man
npmrc
cmd
  • 21 extensions are included in analyses: json, js, md, svg, cs, ts, yml, gitignore, g4, py, csproj, editorconfig, html, txt, gitattributes, MD, man, npmrc, yaml, htm, cmd
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (14 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (63 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.

main20095 LOC (12%) 132 files
test11143 LOC (7%) 44 files
generated11832 LOC (7%) 15 files
build and deployment51 LOC (<1%) 2 files
other114117 LOC (72%) 232 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
g4
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 132 files match defined criteria (20,095 lines of code, 100.0% vs. main code):
    • 80 *.js files (8,601 lines of code)
    • 1 *.yaml files (6,946 lines of code)
    • 15 *.ts files (1,881 lines of code)
    • 22 *.cs files (1,492 lines of code)
    • 4 *.g4 files (720 lines of code)
    • 3 *.py files (274 lines of code)
    • 7 *.yml files (181 lines of code)
  • " *.js" is biggest, containing 42.8% of code.
  • " *.yml" is smallest, containing 0.9% of code.


*.js8601 LOC (42%) 80 files
*.yaml6946 LOC (34%) 1 files
*.ts1881 LOC (9%) 15 files
*.cs1492 LOC (7%) 22 files
*.g4720 LOC (3%) 4 files
*.py274 LOC (1%) 3 files
*.yml181 LOC (<1%) 7 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
man
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 44 files match defined criteria (11,143 lines of code, 55.5% vs. main code):
    • 32 *.js files (10,429 lines of code)
    • 10 *.ts files (605 lines of code)
    • 1 *.yml files (61 lines of code)
    • 1 *.man files (48 lines of code)
  • " *.js" is biggest, containing 93.59% of code.
  • " *.man" is smallest, containing 0.43% of code.


*.js10429 LOC (93%) 32 files
*.ts605 LOC (5%) 10 files
*.yml61 LOC (<1%) 1 files
*.man48 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".
    • files with paths like ".*/generated/.*".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 15 files match defined criteria (11,832 lines of code, 58.9% vs. main code):
    • 4 *.js files (6,628 lines of code)
    • 1 *.json files (4,158 lines of code)
    • 10 *.cs files (1,046 lines of code)
  • " *.js" is biggest, containing 56.02% of code.
  • " *.cs" is smallest, containing 8.84% of code.


*.js6628 LOC (56%) 4 files
*.json4158 LOC (35%) 1 files
*.cs1046 LOC (8%) 10 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
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 ".*[.]csproj".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 2 files match defined criteria (51 lines of code, 0.3% vs. main code). All matches are in *.csproj files.


*.csproj51 LOC (100%) 2 files
Other Code
cmd
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*/[Ee]xamples/.*".
  • 232 files match defined criteria (114,117 lines of code, 567.9% vs. main code):
    • 178 *.json files (110,233 lines of code)
    • 42 *.md files (3,466 lines of code)
    • 8 *.cs files (306 lines of code)
    • 1 *.cmd files (65 lines of code)
    • 1 *.csproj files (36 lines of code)
    • 1 *.html files (10 lines of code)
    • 1 *.svg files (1 lines of code)
  • " *.json" is biggest, containing 96.6% of code.
  • " *.svg" is smallest, containing 0% of code.


*.json110233 LOC (96%) 178 files
*.md3466 LOC (3%) 42 files
*.cs306 LOC (<1%) 8 files
*.cmd65 LOC (<1%) 1 files
*.csproj36 LOC (<1%) 1 files
*.html10 LOC (<1%) 1 files
*.svg1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 (based on namespace heuristics)
  • *.g4 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
  • *.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


2022-01-30 13:30