microsoft / botbuilder-js
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
cmd
g4
gitattributes
editorconfig
tpl
  • 20 extensions are included in analyses: ts, js, json, md, gitignore, yml, txt, cmd, g4, sh, css, gitattributes, ps1, html, MD, xml, editorconfig, svg, Dockerfile, tpl
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (88 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (4 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (4 files).
    • exclude files with path like ".*/react(-[^.]*)?\.js" (React) (4 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) (8 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.

main76257 LOC (36%) 1094 files
test45537 LOC (21%) 301 files
generated22333 LOC (10%) 20 files
build and deployment322 LOC (<1%) 6 files
other63709 LOC (30%) 339 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
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1094 files match defined criteria (76,257 lines of code, 100.0% vs. main code):
    • 927 *.ts files (59,397 lines of code)
    • 132 *.js files (14,319 lines of code)
    • 7 *.g4 files (750 lines of code)
    • 6 *.cmd files (484 lines of code)
    • 3 *.html files (385 lines of code)
    • 1 *.tpl files (287 lines of code)
    • 10 *.yml files (248 lines of code)
    • 3 *.ps1 files (204 lines of code)
    • 2 *.md files (101 lines of code)
    • 3 *.css files (82 lines of code)
  • " *.ts" is biggest, containing 77.89% of code.
  • " *.css" is smallest, containing 0.11% of code.


*.ts59397 LOC (77%) 927 files
*.js14319 LOC (18%) 132 files
*.g4750 LOC (<1%) 7 files
*.cmd484 LOC (<1%) 6 files
*.html385 LOC (<1%) 3 files
*.tpl287 LOC (<1%) 1 files
*.yml248 LOC (<1%) 10 files
*.ps1204 LOC (<1%) 3 files
*.md101 LOC (<1%) 2 files
*.css82 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/TestData/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*[-]tests[-].*".
    • files with paths like ".*/tests_.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*/mock[-].*".
  • 301 files match defined criteria (45,537 lines of code, 59.7% vs. main code):
    • 279 *.js files (43,661 lines of code)
    • 18 *.ts files (1,716 lines of code)
    • 2 *.yml files (90 lines of code)
    • 2 *.cmd files (70 lines of code)
  • " *.js" is biggest, containing 95.88% of code.
  • " *.cmd" is smallest, containing 0.15% of code.


*.js43661 LOC (95%) 279 files
*.ts1716 LOC (3%) 18 files
*.yml90 LOC (<1%) 2 files
*.cmd70 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 ".*/package[-]lock[.]json".
  • 20 files match defined criteria (22,333 lines of code, 29.3% vs. main code):
    • 2 *.json files (15,389 lines of code)
    • 18 *.ts files (6,944 lines of code)
  • " *.json" is biggest, containing 68.91% of code.
  • " *.ts" is smallest, containing 31.09% of code.


*.json15389 LOC (68%) 2 files
*.ts6944 LOC (31%) 18 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[-]lock[.]json".
  • 6 files match defined criteria (322 lines of code, 0.4% vs. main code):
    • 4 *.sh files (226 lines of code)
    • 2 *.js files (96 lines of code)
  • " *.sh" is biggest, containing 70.19% of code.
  • " *.js" is smallest, containing 29.81% of code.


*.sh226 LOC (70%) 4 files
*.js96 LOC (29%) 2 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 ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 339 files match defined criteria (63,709 lines of code, 83.5% vs. main code):
    • 285 *.json files (49,379 lines of code)
    • 53 *.md files (14,267 lines of code)
    • 1 *.xml files (63 lines of code)
  • " *.json" is biggest, containing 77.51% of code.
  • " *.xml" is smallest, containing 0.1% of code.


*.json49379 LOC (77%) 285 files
*.md14267 LOC (22%) 53 files
*.xml63 LOC (<1%) 1 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-30 15:29