microsoft / botbuilder-dotnet
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
csproj
cmd
g4
vstemplate
props
nuspec
editorconfig
vsixmanifest
asax
gitattributes
resx
tpl
  • 25 extensions are included in analyses: cs, json, txt, csproj, md, yml, htm, cmd, g4, ps1, vstemplate, html, props, nuspec, sh, bat, xml, editorconfig, vsixmanifest, asax, js, gitattributes, gitignore, resx, tpl
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (26 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (1 file).
    • 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) (324 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.

main87875 LOC (38%) 1496 files
test84366 LOC (37%) 793 files
generated13231 LOC (5%) 31 files
build and deployment1587 LOC (<1%) 44 files
other38634 LOC (17%) 571 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
g4
vstemplate
tpl
props
vsixmanifest
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1496 files match defined criteria (87,875 lines of code, 100.0% vs. main code):
    • 1,445 *.cs files (83,756 lines of code)
    • 19 *.yml files (1,291 lines of code)
    • 9 *.g4 files (1,091 lines of code)
    • 8 *.ps1 files (680 lines of code)
    • 1 *.html files (331 lines of code)
    • 5 *.vstemplate files (290 lines of code)
    • 1 *.tpl files (287 lines of code)
    • 4 *.props files (93 lines of code)
    • 1 *.vsixmanifest files (30 lines of code)
    • 3 *.cmd files (26 lines of code)
  • " *.cs" is biggest, containing 95.31% of code.
  • " *.cmd" is smallest, containing 0.03% of code.


*.cs83756 LOC (95%) 1445 files
*.yml1291 LOC (1%) 19 files
*.g41091 LOC (1%) 9 files
*.ps1680 LOC (<1%) 8 files
*.html331 LOC (<1%) 1 files
*.vstemplate290 LOC (<1%) 5 files
*.tpl287 LOC (<1%) 1 files
*.props93 LOC (<1%) 4 files
*.vsixmanifest30 LOC (<1%) 1 files
*.cmd26 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
cmd
vstemplate
props
asax
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*[-]tests[-].*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/TestData/.*".
    • files with paths like ".*[.]tests[.].*".
    • files with paths like ".*/Mocks/.*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*TestUtils/.*".
  • 793 files match defined criteria (84,366 lines of code, 96.0% vs. main code):
    • 706 *.cs files (78,978 lines of code)
    • 59 *.csproj files (4,424 lines of code)
    • 7 *.yml files (594 lines of code)
    • 2 *.sh files (114 lines of code)
    • 10 *.cmd files (109 lines of code)
    • 1 *.vstemplate files (62 lines of code)
    • 2 *.htm files (40 lines of code)
    • 3 *.html files (33 lines of code)
    • 1 *.props files (9 lines of code)
    • 1 *.bat files (2 lines of code)
    • 1 *.asax files (1 lines of code)
  • " *.cs" is biggest, containing 93.61% of code.
  • " *.asax" is smallest, containing 0% of code.


*.cs78978 LOC (93%) 706 files
*.csproj4424 LOC (5%) 59 files
*.yml594 LOC (<1%) 7 files
*.sh114 LOC (<1%) 2 files
*.cmd109 LOC (<1%) 10 files
*.vstemplate62 LOC (<1%) 1 files
*.htm40 LOC (<1%) 2 files
*.html33 LOC (<1%) 3 files
*.props9 LOC (<1%) 1 files
*.bat2 LOC (<1%) 1 files
*.asax1 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
    • files with paths like ".*/package[-]lock[.]json".
  • 31 files match defined criteria (13,231 lines of code, 15.1% vs. main code):
    • 30 *.cs files (13,109 lines of code)
    • 1 *.json files (122 lines of code)
  • " *.cs" is biggest, containing 99.08% of code.
  • " *.json" is smallest, containing 0.92% of code.


*.cs13109 LOC (99%) 30 files
*.json122 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
nuspec
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 ".*[.]nuspec".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
  • 44 files match defined criteria (1,587 lines of code, 1.8% vs. main code):
    • 41 *.csproj files (1,526 lines of code)
    • 3 *.nuspec files (61 lines of code)
  • " *.csproj" is biggest, containing 96.16% of code.
  • " *.nuspec" is smallest, containing 3.84% of code.


*.csproj1526 LOC (96%) 41 files
*.nuspec61 LOC (3%) 3 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 ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 571 files match defined criteria (38,634 lines of code, 44.0% vs. main code):
    • 516 *.json files (36,151 lines of code)
    • 53 *.md files (2,467 lines of code)
    • 1 *.xml files (13 lines of code)
    • 1 *.js files (3 lines of code)
  • " *.json" is biggest, containing 93.57% of code.
  • " *.js" is smallest, containing 0.01% of code.


*.json36151 LOC (93%) 516 files
*.md2467 LOC (6%) 53 files
*.xml13 LOC (<1%) 1 files
*.js3 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.vstemplate files are analyzed with XmlAnalyzer:
    • 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
  • *.tpl 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
  • *.props files are analyzed with XmlAnalyzer:
    • 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
  • *.vsixmanifest files are analyzed with XmlAnalyzer:
    • 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


2022-01-30 15:31