microsoft / botframework-solutions
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
csproj
resx
cshtml
props
txt
vstemplate
properties
npmrc
eslintignore
nuspec
pro
npmignore
vsixmanifest
gitattributes
  • 33 extensions are included in analyses: cs, json, md, ts, java, js, ps1, xml, yml, csproj, resx, cshtml, css, gitignore, html, kt, props, gradle, txt, htm, vstemplate, properties, scss, svg, npmrc, eslintignore, nuspec, bat, pro, npmignore, py, vsixmanifest, gitattributes
  • 16 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (55 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (195 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (4 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (3 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (20 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (15 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (0 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (2 files).
    • exclude files with path like ".*/jquery([^.]*)\.validate(\.unobtrusive)?\.js" (jQuery validation plugin (MS bundles this with asp.net mvc)) (0 files).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (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) (3 files).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (0 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.

main17956 LOC (13%) 294 files
test6744 LOC (5%) 84 files
generated31121 LOC (23%) 28 files
build and deployment433 LOC (<1%) 10 files
other76661 LOC (57%) 729 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vstemplate
props
vsixmanifest
eslintignore
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 294 files match defined criteria (17,956 lines of code, 100.0% vs. main code):
    • 138 *.ts files (5,859 lines of code)
    • 32 *.ps1 files (5,357 lines of code)
    • 96 *.cs files (4,657 lines of code)
    • 4 *.js files (809 lines of code)
    • 13 *.yml files (627 lines of code)
    • 4 *.vstemplate files (340 lines of code)
    • 1 *.css files (106 lines of code)
    • 2 *.props files (72 lines of code)
    • 1 *.html files (53 lines of code)
    • 1 *.py files (52 lines of code)
    • 1 *.vsixmanifest files (22 lines of code)
    • 1 *.eslintignore files (2 lines of code)
  • " *.ts" is biggest, containing 32.63% of code.
  • " *.eslintignore" is smallest, containing 0.01% of code.


*.ts5859 LOC (32%) 138 files
*.ps15357 LOC (29%) 32 files
*.cs4657 LOC (25%) 96 files
*.js809 LOC (4%) 4 files
*.yml627 LOC (3%) 13 files
*.vstemplate340 LOC (1%) 4 files
*.css106 LOC (<1%) 1 files
*.props72 LOC (<1%) 2 files
*.html53 LOC (<1%) 1 files
*.py52 LOC (<1%) 1 files
*.vsixmanifest22 LOC (<1%) 1 files
*.eslintignore2 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
vstemplate
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 ".*/Mocks/.*".
    • files with paths like ".*/TestData/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 84 files match defined criteria (6,744 lines of code, 37.6% vs. main code):
    • 40 *.js files (3,853 lines of code)
    • 39 *.cs files (2,654 lines of code)
    • 3 *.csproj files (156 lines of code)
    • 2 *.vstemplate files (81 lines of code)
  • " *.js" is biggest, containing 57.13% of code.
  • " *.vstemplate" is smallest, containing 1.2% of code.


*.js3853 LOC (57%) 40 files
*.cs2654 LOC (39%) 39 files
*.csproj156 LOC (2%) 3 files
*.vstemplate81 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 ".*/package[-]lock[.]json".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 28 files match defined criteria (31,121 lines of code, 173.3% vs. main code):
    • 5 *.json files (28,994 lines of code)
    • 23 *.cs files (2,127 lines of code)
  • " *.json" is biggest, containing 93.17% of code.
  • " *.cs" is smallest, containing 6.83% of code.


*.json28994 LOC (93%) 5 files
*.cs2127 LOC (6%) 23 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 ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
  • 10 files match defined criteria (433 lines of code, 2.4% vs. main code):
    • 4 *.csproj files (315 lines of code)
    • 4 *.nuspec files (92 lines of code)
    • 2 *.gitignore files (26 lines of code)
  • " *.csproj" is biggest, containing 72.75% of code.
  • " *.gitignore" is smallest, containing 6% of code.


*.csproj315 LOC (72%) 4 files
*.nuspec92 LOC (21%) 4 files
*.gitignore26 LOC (6%) 2 files
Other Code
csproj
cshtml
props
properties
npmrc
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 ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 729 files match defined criteria (76,661 lines of code, 426.9% vs. main code):
    • 245 *.json files (44,434 lines of code)
    • 179 *.cs files (11,594 lines of code)
    • 36 *.ps1 files (7,537 lines of code)
    • 62 *.java files (4,190 lines of code)
    • 56 *.xml files (2,348 lines of code)
    • 29 *.ts files (1,851 lines of code)
    • 14 *.js files (1,119 lines of code)
    • 17 *.csproj files (722 lines of code)
    • 8 *.kt files (653 lines of code)
    • 7 *.yml files (637 lines of code)
    • 34 *.md files (495 lines of code)
    • 20 *.cshtml files (483 lines of code)
    • 3 *.bat files (197 lines of code)
    • 7 *.gradle files (162 lines of code)
    • 5 *.props files (146 lines of code)
    • 3 *.css files (55 lines of code)
    • 2 *.properties files (34 lines of code)
    • 2 *.npmrc files (4 lines of code)
  • " *.json" is biggest, containing 57.96% of code.
  • " *.npmrc" is smallest, containing 0.01% of code.


*.json44434 LOC (57%) 245 files
*.cs11594 LOC (15%) 179 files
*.ps17537 LOC (9%) 36 files
*.java4190 LOC (5%) 62 files
*.xml2348 LOC (3%) 56 files
*.ts1851 LOC (2%) 29 files
*.js1119 LOC (1%) 14 files
*.csproj722 LOC (<1%) 17 files
*.kt653 LOC (<1%) 8 files
*.yml637 LOC (<1%) 7 files
*.md495 LOC (<1%) 34 files
*.cshtml483 LOC (<1%) 20 files
*.bat197 LOC (<1%) 3 files
*.gradle162 LOC (<1%) 7 files
*.props146 LOC (<1%) 5 files
*.css55 LOC (<1%) 3 files
*.properties34 LOC (<1%) 2 files
*.npmrc4 LOC (<1%) 2 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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.eslintignore 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 22:04