microsoft / DiagManager
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
txt
resx
CMD
vbs
csproj
VBS
  • 18 extensions are included in analyses: sql, sh, cs, XML, cmd, xml, bat, md, txt, ps1, resx, CMD, vbs, csproj, js, json, gitignore, VBS
  • 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) (6 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) (6 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.

main6415 LOC (7%) 98 files
test0 LOC (0%) 0 files
generated927 LOC (1%) 1 files
build and deployment5469 LOC (6%) 64 files
other75769 LOC (85%) 86 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmd
vbs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 98 files match defined criteria (6,415 lines of code, 100.0% vs. main code):
    • 45 *.cs files (4,520 lines of code)
    • 6 *.ps1 files (919 lines of code)
    • 21 *.cmd files (502 lines of code)
    • 1 *.js files (254 lines of code)
    • 21 *.xml files (122 lines of code)
    • 4 *.vbs files (98 lines of code)
  • " *.cs" is biggest, containing 70.46% of code.
  • " *.vbs" is smallest, containing 1.53% of code.


*.cs4520 LOC (70%) 45 files
*.ps1919 LOC (14%) 6 files
*.cmd502 LOC (7%) 21 files
*.js254 LOC (3%) 1 files
*.xml122 LOC (1%) 21 files
*.vbs98 LOC (1%) 4 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 ".*[.]designer[.](cs|vb)".
  • 1 file matches defined criteria (927 lines of code, 14.5% vs. main code). All matches are in *.cs files.


*.cs927 LOC (100%) 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 ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]csproj".
  • 64 files match defined criteria (5,469 lines of code, 85.3% vs. main code):
    • 2 *.csproj files (2,541 lines of code)
    • 54 *.sh files (2,469 lines of code)
    • 8 *.bat files (459 lines of code)
  • " *.csproj" is biggest, containing 46.46% of code.
  • " *.bat" is smallest, containing 8.39% of code.


*.csproj2541 LOC (46%) 2 files
*.sh2469 LOC (45%) 54 files
*.bat459 LOC (8%) 8 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 86 files match defined criteria (75,769 lines of code, 1181.1% vs. main code):
    • 9 *.xml files (52,264 lines of code)
    • 72 *.sql files (23,406 lines of code)
    • 5 *.md files (99 lines of code)
  • " *.xml" is biggest, containing 68.98% of code.
  • " *.md" is smallest, containing 0.13% of code.


*.xml52264 LOC (68%) 9 files
*.sql23406 LOC (30%) 72 files
*.md99 LOC (<1%) 5 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
  • *.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
  • *.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
  • *.xml 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
  • *.vbs files are analyzed with VisualBasicAnalyzer:
    • 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:03