microsoft / botframework-cli
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
editorconfig
txt
cmd
csproj
nuspec
eslintignore
npmrc
g4
gitattributes
  • 18 extensions are included in analyses: ts, json, js, md, cs, gitignore, editorconfig, txt, cmd, yml, csproj, nuspec, eslintignore, MD, npmrc, g4, gitattributes, yaml
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (42 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (10 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (21 files).
    • exclude files with path like ".*/[Pp]ackages\/.+\.\d+\/.*" (NuGet) (5 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) (10 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.

main67513 LOC (3%) 484 files
test1153304 LOC (60%) 206 files
generated9362 LOC (<1%) 28 files
build and deployment0 LOC (0%) 0 files
other671305 LOC (35%) 525 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 ".*".
  • 484 files match defined criteria (67,513 lines of code, 100.0% vs. main code):
    • 356 *.ts files (48,580 lines of code)
    • 119 *.js files (10,231 lines of code)
    • 1 *.yaml files (8,162 lines of code)
    • 2 *.g4 files (365 lines of code)
    • 6 *.yml files (175 lines of code)
  • " *.ts" is biggest, containing 71.96% of code.
  • " *.yml" is smallest, containing 0.26% of code.


*.ts48580 LOC (71%) 356 files
*.js10231 LOC (15%) 119 files
*.yaml8162 LOC (12%) 1 files
*.g4365 LOC (<1%) 2 files
*.yml175 LOC (<1%) 6 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
cmd
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 ".*/TestData/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 206 files match defined criteria (1,153,304 lines of code, 1708.3% vs. main code):
    • 153 *.ts files (1,138,767 lines of code)
    • 42 *.js files (14,000 lines of code)
    • 6 *.csproj files (222 lines of code)
    • 2 *.cs files (189 lines of code)
    • 1 *.yml files (75 lines of code)
    • 2 *.cmd files (51 lines of code)
  • " *.ts" is biggest, containing 98.74% of code.
  • " *.cmd" is smallest, containing 0% of code.


*.ts1138767 LOC (98%) 153 files
*.js14000 LOC (1%) 42 files
*.csproj222 LOC (<1%) 6 files
*.cs189 LOC (<1%) 2 files
*.yml75 LOC (<1%) 1 files
*.cmd51 LOC (<1%) 2 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 ".*/generated/.*".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 28 files match defined criteria (9,362 lines of code, 13.9% vs. main code):
    • 4 *.js files (6,730 lines of code)
    • 24 *.cs files (2,632 lines of code)
  • " *.js" is biggest, containing 71.89% of code.
  • " *.cs" is smallest, containing 28.11% of code.


*.js6730 LOC (71%) 4 files
*.cs2632 LOC (28%) 24 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 ".*[.]npmrc".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]eslintignore".
  • 525 files match defined criteria (671,305 lines of code, 994.3% vs. main code):
    • 485 *.json files (665,050 lines of code)
    • 40 *.md files (6,255 lines of code)
  • " *.json" is biggest, containing 99.07% of code.
  • " *.md" is smallest, containing 0.93% of code.


*.json665050 LOC (99%) 485 files
*.md6255 LOC (<1%) 40 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
  • *.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
  • *.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
  • *.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-31 01:14