microsoft / ApplicationInsights-dotnet
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
cmd
cshtml
props
shproj
targets
gitattributes
in
proj
resx
  • 21 extensions are included in analyses: cs, txt, json, csproj, cmd, md, ps1, cshtml, props, yml, xml, shproj, targets, svg, css, js, gitattributes, gitignore, in, proj, resx
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (110 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (7 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (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) (3 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.

main56249 LOC (39%) 745 files
test80348 LOC (55%) 539 files
generated2359 LOC (1%) 58 files
build and deployment537 LOC (<1%) 16 files
other4488 LOC (3%) 102 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmd
targets
props
shproj
proj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 745 files match defined criteria (56,249 lines of code, 100.0% vs. main code):
    • 685 *.cs files (55,126 lines of code)
    • 9 *.ps1 files (488 lines of code)
    • 31 *.cmd files (287 lines of code)
    • 7 *.targets files (124 lines of code)
    • 5 *.props files (112 lines of code)
    • 7 *.shproj files (87 lines of code)
    • 1 *.proj files (25 lines of code)
  • " *.cs" is biggest, containing 98% of code.
  • " *.proj" is smallest, containing 0.04% of code.


*.cs55126 LOC (98%) 685 files
*.ps1488 LOC (<1%) 9 files
*.cmd287 LOC (<1%) 31 files
*.targets124 LOC (<1%) 7 files
*.props112 LOC (<1%) 5 files
*.shproj87 LOC (<1%) 7 files
*.proj25 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
cshtml
shproj
in
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*/Mocks/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 539 files match defined criteria (80,348 lines of code, 142.8% vs. main code):
    • 495 *.cs files (78,988 lines of code)
    • 27 *.csproj files (997 lines of code)
    • 8 *.cshtml files (238 lines of code)
    • 3 *.shproj files (37 lines of code)
    • 1 *.ps1 files (36 lines of code)
    • 2 *.css files (24 lines of code)
    • 1 *.in files (19 lines of code)
    • 1 *.props files (8 lines of code)
    • 1 *.js files (1 lines of code)
  • " *.cs" is biggest, containing 98.31% of code.
  • " *.js" is smallest, containing 0% of code.


*.cs78988 LOC (98%) 495 files
*.csproj997 LOC (1%) 27 files
*.cshtml238 LOC (<1%) 8 files
*.shproj37 LOC (<1%) 3 files
*.ps136 LOC (<1%) 1 files
*.css24 LOC (<1%) 2 files
*.in19 LOC (<1%) 1 files
*.props8 LOC (<1%) 1 files
*.js1 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 "[/][/][ ]*".
  • 58 files match defined criteria (2,359 lines of code, 4.2% vs. main code). All matches are in *.cs files.


*.cs2359 LOC (100%) 58 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".
  • 16 files match defined criteria (537 lines of code, 1.0% vs. main code). All matches are in *.csproj files.


*.csproj537 LOC (100%) 16 files
Other Code
cshtml
csproj
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 102 files match defined criteria (4,488 lines of code, 8.0% vs. main code):
    • 17 *.md files (1,974 lines of code)
    • 55 *.json files (1,034 lines of code)
    • 10 *.xml files (926 lines of code)
    • 9 *.cs files (414 lines of code)
    • 7 *.cshtml files (86 lines of code)
    • 4 *.csproj files (54 lines of code)
  • " *.md" is biggest, containing 43.98% of code.
  • " *.csproj" is smallest, containing 1.2% of code.


*.md1974 LOC (43%) 17 files
*.json1034 LOC (23%) 55 files
*.xml926 LOC (20%) 10 files
*.cs414 LOC (9%) 9 files
*.cshtml86 LOC (1%) 7 files
*.csproj54 LOC (1%) 4 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
  • *.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
  • *.shproj 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
  • *.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


2022-01-30 10:18