microsoft / DbgShell
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
vcxproj
filters
in
xsd
gitattributes
editorconfig
resx
xslt
  • 22 extensions are included in analyses: cs, ps1, ps1xml, h, txt, md, cpp, csproj, psm1, vcxproj, filters, psd1, in, xsd, js, gitattributes, xml, json, editorconfig, gitignore, resx, xslt
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (3 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) (16 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.

main147103 LOC (90%) 392 files
test13433 LOC (8%) 118 files
generated0 LOC (0%) 0 files
build and deployment806 LOC (<1%) 4 files
other1564 LOC (<1%) 13 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
vcxproj
filters
xslt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 392 files match defined criteria (147,103 lines of code, 100.0% vs. main code):
    • 335 *.cs files (103,625 lines of code)
    • 16 *.h files (26,546 lines of code)
    • 3 *.psm1 files (7,067 lines of code)
    • 9 *.cpp files (4,976 lines of code)
    • 16 *.ps1 files (2,457 lines of code)
    • 3 *.in files (1,347 lines of code)
    • 3 *.vcxproj files (659 lines of code)
    • 3 *.filters files (139 lines of code)
    • 1 *.xslt files (129 lines of code)
    • 1 *.psd1 files (62 lines of code)
    • 1 *.js files (62 lines of code)
    • 1 *.ps1xml files (34 lines of code)
  • " *.cs" is biggest, containing 70.44% of code.
  • " *.ps1xml" is smallest, containing 0.02% of code.


*.cs103625 LOC (70%) 335 files
*.h26546 LOC (18%) 16 files
*.psm17067 LOC (4%) 3 files
*.cpp4976 LOC (3%) 9 files
*.ps12457 LOC (1%) 16 files
*.in1347 LOC (<1%) 3 files
*.vcxproj659 LOC (<1%) 3 files
*.filters139 LOC (<1%) 3 files
*.xslt129 LOC (<1%) 1 files
*.psd162 LOC (<1%) 1 files
*.js62 LOC (<1%) 1 files
*.ps1xml34 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
vcxproj
filters
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 ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 118 files match defined criteria (13,433 lines of code, 9.1% vs. main code):
    • 86 *.ps1 files (9,928 lines of code)
    • 1 *.cpp files (1,044 lines of code)
    • 2 *.psm1 files (1,012 lines of code)
    • 2 *.csproj files (469 lines of code)
    • 4 *.cs files (334 lines of code)
    • 17 *.ps1xml files (255 lines of code)
    • 1 *.vcxproj files (197 lines of code)
    • 2 *.psd1 files (159 lines of code)
    • 1 *.filters files (30 lines of code)
    • 2 *.h files (5 lines of code)
  • " *.ps1" is biggest, containing 73.91% of code.
  • " *.h" is smallest, containing 0.04% of code.


*.ps19928 LOC (73%) 86 files
*.cpp1044 LOC (7%) 1 files
*.psm11012 LOC (7%) 2 files
*.csproj469 LOC (3%) 2 files
*.cs334 LOC (2%) 4 files
*.ps1xml255 LOC (1%) 17 files
*.vcxproj197 LOC (1%) 1 files
*.psd1159 LOC (1%) 2 files
*.filters30 LOC (<1%) 1 files
*.h5 LOC (<1%) 2 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]csproj".
  • 4 files match defined criteria (806 lines of code, 0.5% vs. main code). All matches are in *.csproj files.


*.csproj806 LOC (100%) 4 files
Other Code
xsd
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 ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 13 files match defined criteria (1,564 lines of code, 1.1% vs. main code):
    • 11 *.md files (1,343 lines of code)
    • 1 *.xml files (113 lines of code)
    • 1 *.xsd files (108 lines of code)
  • " *.md" is biggest, containing 85.87% of code.
  • " *.xsd" is smallest, containing 6.91% of code.


*.md1343 LOC (85%) 11 files
*.xml113 LOC (7%) 1 files
*.xsd108 LOC (6%) 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)
  • *.h files are analyzed with CppAnalyzer:
    • 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
  • *.psm1 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
  • *.cpp files are analyzed with CppAnalyzer:
    • 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
  • *.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
  • *.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
  • *.vcxproj 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
  • *.filters 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
  • *.xslt 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
  • *.psd1 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
  • *.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
  • *.ps1xml 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


2022-01-30 15:13