microsoft / botbuilder-tools
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
cmd
gitattributes
g4
txt
csproj
editorconfig
eslintignore
  • 17 extensions are included in analyses: json, js, ts, md, cs, gitignore, cmd, ps1, MD, gitattributes, g4, txt, csproj, sh, editorconfig, yml, eslintignore
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (27 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (8 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (22 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.

main24190 LOC (14%) 172 files
test7870 LOC (4%) 45 files
generated21580 LOC (13%) 16 files
build and deployment103 LOC (<1%) 2 files
other111674 LOC (67%) 354 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
g4
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 172 files match defined criteria (24,190 lines of code, 100.0% vs. main code):
    • 62 *.ts files (16,719 lines of code)
    • 95 *.js files (6,146 lines of code)
    • 5 *.cs files (829 lines of code)
    • 2 *.g4 files (224 lines of code)
    • 3 *.ps1 files (133 lines of code)
    • 2 *.md files (102 lines of code)
    • 3 *.cmd files (37 lines of code)
  • " *.ts" is biggest, containing 69.12% of code.
  • " *.cmd" is smallest, containing 0.15% of code.


*.ts16719 LOC (69%) 62 files
*.js6146 LOC (25%) 95 files
*.cs829 LOC (3%) 5 files
*.g4224 LOC (<1%) 2 files
*.ps1133 LOC (<1%) 3 files
*.md102 LOC (<1%) 2 files
*.cmd37 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cmd
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/TestData/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 45 files match defined criteria (7,870 lines of code, 32.5% vs. main code):
    • 38 *.js files (7,184 lines of code)
    • 2 *.ts files (404 lines of code)
    • 2 *.cs files (194 lines of code)
    • 2 *.cmd files (64 lines of code)
    • 1 *.csproj files (24 lines of code)
  • " *.js" is biggest, containing 91.28% of code.
  • " *.csproj" is smallest, containing 0.3% of code.


*.js7184 LOC (91%) 38 files
*.ts404 LOC (5%) 2 files
*.cs194 LOC (2%) 2 files
*.cmd64 LOC (<1%) 2 files
*.csproj24 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
    • files with paths like ".*/generated/.*".
  • 16 files match defined criteria (21,580 lines of code, 89.2% vs. main code):
    • 11 *.json files (17,949 lines of code)
    • 4 *.js files (3,383 lines of code)
    • 1 *.cs files (248 lines of code)
  • " *.json" is biggest, containing 83.17% of code.
  • " *.cs" is smallest, containing 1.15% of code.


*.json17949 LOC (83%) 11 files
*.js3383 LOC (15%) 4 files
*.cs248 LOC (1%) 1 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 ".*/package[-]lock[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]csproj".
  • 2 files match defined criteria (103 lines of code, 0.4% vs. main code):
    • 1 *.sh files (58 lines of code)
    • 1 *.csproj files (45 lines of code)
  • " *.sh" is biggest, containing 56.31% of code.
  • " *.csproj" is smallest, containing 43.69% of code.


*.sh58 LOC (56%) 1 files
*.csproj45 LOC (43%) 1 files
Other Code
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 ".*/[.]eslintignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
  • 354 files match defined criteria (111,674 lines of code, 461.7% vs. main code):
    • 337 *.json files (110,088 lines of code)
    • 17 *.md files (1,586 lines of code)
  • " *.json" is biggest, containing 98.58% of code.
  • " *.md" is smallest, containing 1.42% of code.


*.json110088 LOC (98%) 337 files
*.md1586 LOC (1%) 17 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-30 15:45