microsoft / Recognizers-Text
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
cmd
csproj
cfg
npmignore
nuspec
in
txt
babelrc
DotSettings
  • 26 extensions are included in analyses: cs, java, json, py, ts, yaml, js, cmd, md, xml, csproj, cfg, npmignore, rst, nuspec, in, gitignore, txt, sh, ps1, html, babelrc, bat, yml, DotSettings, htm
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (1367 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) (4 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.

main163086 LOC (17%) 1222 files
test12699 LOC (1%) 103 files
generated11061 LOC (1%) 7 files
build and deployment76 LOC (<1%) 5 files
other753055 LOC (80%) 581 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmd
cfg
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1222 files match defined criteria (163,086 lines of code, 100.0% vs. main code):
    • 559 *.java files (51,853 lines of code)
    • 327 *.py files (43,130 lines of code)
    • 89 *.yaml files (41,691 lines of code)
    • 181 *.ts files (23,994 lines of code)
    • 28 *.js files (1,605 lines of code)
    • 2 *.cs files (437 lines of code)
    • 19 *.cmd files (292 lines of code)
    • 1 *.yml files (51 lines of code)
    • 9 *.cfg files (26 lines of code)
    • 7 *.in files (7 lines of code)
  • " *.java" is biggest, containing 31.79% of code.
  • " *.in" is smallest, containing 0% of code.


*.java51853 LOC (31%) 559 files
*.py43130 LOC (26%) 327 files
*.yaml41691 LOC (25%) 89 files
*.ts23994 LOC (14%) 181 files
*.js1605 LOC (<1%) 28 files
*.cs437 LOC (<1%) 2 files
*.cmd292 LOC (<1%) 19 files
*.yml51 LOC (<1%) 1 files
*.cfg26 LOC (<1%) 9 files
*.in7 LOC (<1%) 7 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 ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.]spec[.]js".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 103 files match defined criteria (12,699 lines of code, 7.8% vs. main code):
    • 41 *.java files (6,116 lines of code)
    • 39 *.js files (3,917 lines of code)
    • 22 *.py files (2,641 lines of code)
    • 1 *.html files (25 lines of code)
  • " *.java" is biggest, containing 48.16% of code.
  • " *.html" is smallest, containing 0.2% of code.


*.java6116 LOC (48%) 41 files
*.js3917 LOC (30%) 39 files
*.py2641 LOC (20%) 22 files
*.html25 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".
  • 7 files match defined criteria (11,061 lines of code, 6.8% vs. main code). All matches are in *.json files.


*.json11061 LOC (100%) 7 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
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 ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]bat".
  • 5 files match defined criteria (76 lines of code, 0.0% vs. main code):
    • 3 *.sh files (38 lines of code)
    • 1 *.csproj files (28 lines of code)
    • 1 *.bat files (10 lines of code)
  • " *.sh" is biggest, containing 50% of code.
  • " *.bat" is smallest, containing 13.16% of code.


*.sh38 LOC (50%) 3 files
*.csproj28 LOC (36%) 1 files
*.bat10 LOC (13%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 581 files match defined criteria (753,055 lines of code, 461.8% vs. main code):
    • 534 *.json files (750,357 lines of code)
    • 21 *.md files (1,140 lines of code)
    • 13 *.xml files (998 lines of code)
    • 3 *.js files (264 lines of code)
    • 1 *.html files (108 lines of code)
    • 1 *.java files (84 lines of code)
    • 1 *.py files (57 lines of code)
    • 7 *.rst files (47 lines of code)
  • " *.json" is biggest, containing 99.64% of code.
  • " *.rst" is smallest, containing 0.01% of code.


*.json750357 LOC (99%) 534 files
*.md1140 LOC (<1%) 21 files
*.xml998 LOC (<1%) 13 files
*.js264 LOC (<1%) 3 files
*.html108 LOC (<1%) 1 files
*.java84 LOC (<1%) 1 files
*.py57 LOC (<1%) 1 files
*.rst47 LOC (<1%) 7 files
Analyzers
Info about analyzers used for source code examinations.
  • *.java files are analyzed with JavaAnalyzer:
    • 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 package names)
  • *.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
  • *.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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.in files are analyzed with RustAnalyzer:
    • 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


2022-01-30 14:52