microsoft / clrmd
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
txt
cmd
props
targets
patch
proj
gitattributes
editorconfig
cmake
  • 20 extensions are included in analyses: cs, yml, ps1, csproj, sh, txt, md, cmd, props, json, targets, patch, proj, gitattributes, psm1, xml, editorconfig, psd1, gitignore, cmake
  • 5 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 ".*/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.

main45709 LOC (86%) 685 files
test3282 LOC (6%) 37 files
generated0 LOC (0%) 0 files
build and deployment2731 LOC (5%) 39 files
other989 LOC (1%) 25 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
proj
targets
props
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 685 files match defined criteria (45,709 lines of code, 100.0% vs. main code):
    • 610 *.cs files (39,218 lines of code)
    • 27 *.ps1 files (3,189 lines of code)
    • 29 *.yml files (2,385 lines of code)
    • 1 *.psm1 files (344 lines of code)
    • 1 *.cmake files (231 lines of code)
    • 2 *.proj files (184 lines of code)
    • 3 *.targets files (83 lines of code)
    • 5 *.props files (48 lines of code)
    • 6 *.cmd files (16 lines of code)
    • 1 *.psd1 files (11 lines of code)
  • " *.cs" is biggest, containing 85.8% of code.
  • " *.psd1" is smallest, containing 0.02% of code.


*.cs39218 LOC (85%) 610 files
*.ps13189 LOC (6%) 27 files
*.yml2385 LOC (5%) 29 files
*.psm1344 LOC (<1%) 1 files
*.cmake231 LOC (<1%) 1 files
*.proj184 LOC (<1%) 2 files
*.targets83 LOC (<1%) 3 files
*.props48 LOC (<1%) 5 files
*.cmd16 LOC (<1%) 6 files
*.psd111 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 37 files match defined criteria (3,282 lines of code, 7.2% vs. main code):
    • 36 *.cs files (3,256 lines of code)
    • 1 *.csproj files (26 lines of code)
  • " *.cs" is biggest, containing 99.21% of code.
  • " *.csproj" is smallest, containing 0.79% of code.


*.cs3256 LOC (99%) 36 files
*.csproj26 LOC (<1%) 1 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 ".*[.]sh".
    • files with paths like ".*[.]csproj".
  • 39 files match defined criteria (2,731 lines of code, 6.0% vs. main code):
    • 21 *.sh files (2,453 lines of code)
    • 18 *.csproj files (278 lines of code)
  • " *.sh" is biggest, containing 89.82% of code.
  • " *.csproj" is smallest, containing 10.18% of code.


*.sh2453 LOC (89%) 21 files
*.csproj278 LOC (10%) 18 files
Other Code
csproj
patch
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 ".*[.]patch".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 25 files match defined criteria (989 lines of code, 2.2% vs. main code):
    • 6 *.md files (422 lines of code)
    • 7 *.cs files (417 lines of code)
    • 6 *.csproj files (55 lines of code)
    • 2 *.patch files (52 lines of code)
    • 3 *.json files (32 lines of code)
    • 1 *.xml files (11 lines of code)
  • " *.md" is biggest, containing 42.67% of code.
  • " *.xml" is smallest, containing 1.11% of code.


*.md422 LOC (42%) 6 files
*.cs417 LOC (42%) 7 files
*.csproj55 LOC (5%) 6 files
*.patch52 LOC (5%) 2 files
*.json32 LOC (3%) 3 files
*.xml11 LOC (1%) 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)
  • *.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
  • *.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
  • *.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
  • *.cmake 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
  • *.proj 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
  • *.targets 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
  • *.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
  • *.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
  • *.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


2022-01-30 11:09