microsoft / BotFramework-WebChat
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
dockerignore
mjs
txt
csproj
pug
gitattributes
prettierignore
  • 22 extensions are included in analyses: js, html, ts, json, md, tsx, yml, gitignore, css, svg, cs, dockerignore, yaml, sh, dockerfile, mjs, txt, csproj, pug, gitattributes, ps1, prettierignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (103 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (16 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (13 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (2 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) (3 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.

main20842 LOC (2%) 598 files
test29115 LOC (3%) 834 files
generated355111 LOC (44%) 40 files
build and deployment353 LOC (<1%) 10 files
other386727 LOC (48%) 614 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
mjs
pug
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 598 files match defined criteria (20,842 lines of code, 100.0% vs. main code):
    • 306 *.js files (8,122 lines of code)
    • 221 *.ts files (6,393 lines of code)
    • 61 *.tsx files (5,878 lines of code)
    • 4 *.mjs files (240 lines of code)
    • 3 *.yml files (129 lines of code)
    • 1 *.ps1 files (49 lines of code)
    • 1 *.html files (17 lines of code)
    • 1 *.pug files (14 lines of code)
  • " *.js" is biggest, containing 38.97% of code.
  • " *.pug" is smallest, containing 0.07% of code.


*.js8122 LOC (38%) 306 files
*.ts6393 LOC (30%) 221 files
*.tsx5878 LOC (28%) 61 files
*.mjs240 LOC (1%) 4 files
*.yml129 LOC (<1%) 3 files
*.ps149 LOC (<1%) 1 files
*.html17 LOC (<1%) 1 files
*.pug14 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*[.]spec[.]js".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 834 files match defined criteria (29,115 lines of code, 139.7% vs. main code):
    • 618 *.js files (15,971 lines of code)
    • 192 *.html files (12,946 lines of code)
    • 3 *.css files (122 lines of code)
    • 15 *.tsx files (59 lines of code)
    • 6 *.ts files (17 lines of code)
  • " *.js" is biggest, containing 54.85% of code.
  • " *.ts" is smallest, containing 0.06% of code.


*.js15971 LOC (54%) 618 files
*.html12946 LOC (44%) 192 files
*.css122 LOC (<1%) 3 files
*.tsx59 LOC (<1%) 15 files
*.ts17 LOC (<1%) 6 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".
  • 40 files match defined criteria (355,111 lines of code, 1703.8% vs. main code). All matches are in *.json files.


*.json355111 LOC (100%) 40 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]dockerfile".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]csproj".
  • 10 files match defined criteria (353 lines of code, 1.7% vs. main code):
    • 5 *.js files (229 lines of code)
    • 1 *.yml files (81 lines of code)
    • 4 *.dockerfile files (43 lines of code)
  • " *.js" is biggest, containing 64.87% of code.
  • " *.dockerfile" is smallest, containing 12.18% of code.


*.js229 LOC (64%) 5 files
*.yml81 LOC (22%) 1 files
*.dockerfile43 LOC (12%) 4 files
Other Code
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]svg".
  • 614 files match defined criteria (386,727 lines of code, 1855.5% vs. main code):
    • 189 *.json files (362,791 lines of code)
    • 74 *.md files (11,343 lines of code)
    • 68 *.html files (5,822 lines of code)
    • 218 *.js files (5,372 lines of code)
    • 29 *.css files (800 lines of code)
    • 10 *.cs files (292 lines of code)
    • 9 *.yml files (269 lines of code)
    • 5 *.sh files (15 lines of code)
    • 2 *.csproj files (13 lines of code)
    • 10 *.svg files (10 lines of code)
  • " *.json" is biggest, containing 93.81% of code.
  • " *.svg" is smallest, containing 0% of code.


*.json362791 LOC (93%) 189 files
*.md11343 LOC (2%) 74 files
*.html5822 LOC (1%) 68 files
*.js5372 LOC (1%) 218 files
*.css800 LOC (<1%) 29 files
*.cs292 LOC (<1%) 10 files
*.yml269 LOC (<1%) 9 files
*.sh15 LOC (<1%) 5 files
*.csproj13 LOC (<1%) 2 files
*.svg10 LOC (<1%) 10 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
  • *.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
  • *.tsx 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
  • *.mjs 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
  • *.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
  • *.pug 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 13:48