GoogleCloudPlatform / dotnet-docs-samples
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
cshtml
snap
cfg
txt
proto
fs
vbproj
fsproj
asax
gitattributes
editorconfig
props
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.

main72364 LOC (72%) 1,132 files
test21628 LOC (21%) 769 files
generated553 LOC (<1%) 4 files
build and deployment2194 LOC (2%) 152 files
other3289 LOC (3%) 112 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cshtml
fs
proto
fsproj
props
asax
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1132 files match defined criteria (72,364 LOC, 100.0% vs. main code):
    • 934 *.cs files (39,192 LOC)
    • 13 *.css files (17,058 LOC)
    • 6 *.js files (8,702 LOC)
    • 87 *.ps1 files (3,542 LOC)
    • 56 *.cshtml files (2,213 LOC)
    • 1 *.psm1 files (966 LOC)
    • 19 *.yaml files (421 LOC)
    • 3 *.html files (80 LOC)
    • 2 *.fs files (52 LOC)
    • 2 *.avsc files (42 LOC)
    • 3 *.proto files (37 LOC)
    • 2 *.vb files (27 LOC)
    • 2 *.fsproj files (25 LOC)
    • 1 *.props files (6 LOC)
    • 1 *.asax files (1 LOC)
  • " *.cs" is biggest, containing 54.16% of LOC.
  • " *.asax" is smallest, containing 0% of LOC.


*.cs39192 LOC (54%) 934 files
*.css17058 LOC (23%) 13 files
*.js8702 LOC (12%) 6 files
*.ps13542 LOC (4%) 87 files
*.cshtml2213 LOC (3%) 56 files
*.psm1966 LOC (1%) 1 file
*.yaml421 LOC (<1%) 19 files
*.html80 LOC (<1%) 3 files
*.fs52 LOC (<1%) 2 files
*.avsc42 LOC (<1%) 2 files
*.proto37 LOC (<1%) 3 files
*.vb27 LOC (<1%) 2 files
*.fsproj25 LOC (<1%) 2 files
*.props6 LOC (<1%) 1 file
*.asax1 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
snap
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 paths like ".*/test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[.]snap".
  • 769 files match defined criteria (21,628 LOC, 29.9% vs. main code):
    • 693 *.cs files (19,939 LOC)
    • 42 *.csproj files (820 LOC)
    • 8 *.ps1 files (395 LOC)
    • 19 *.snap files (372 LOC)
    • 7 *.js files (102 LOC)
  • " *.cs" is biggest, containing 92.19% of LOC.
  • " *.js" is smallest, containing 0.47% of LOC.


*.cs19939 LOC (92%) 693 files
*.csproj820 LOC (3%) 42 files
*.ps1395 LOC (1%) 8 files
*.snap372 LOC (1%) 19 files
*.js102 LOC (<1%) 7 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with any line of content like "//[ ]*Generated by .*".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 4 files match defined criteria (553 LOC, 0.8% vs. main code). All matches are in *.cs files.


*.cs553 LOC (100%) 4 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
vbproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]vbproj".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]bat".
  • 152 files match defined criteria (2,194 LOC, 3.0% vs. main code):
    • 146 *.csproj files (2,074 LOC)
    • 4 *.sh files (99 LOC)
    • 2 *.vbproj files (21 LOC)
  • " *.csproj" is biggest, containing 94.53% of LOC.
  • " *.vbproj" is smallest, containing 0.96% of LOC.


*.csproj2074 LOC (94%) 146 files
*.sh99 LOC (4%) 4 files
*.vbproj21 LOC (<1%) 2 files
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]editorconfig".
  • 112 files match defined criteria (3,289 LOC, 4.5% vs. main code):
    • 66 *.md files (2,252 LOC)
    • 40 *.json files (977 LOC)
    • 6 *.txt files (60 LOC)
  • " *.md" is biggest, containing 68.47% of LOC.
  • " *.txt" is smallest, containing 1.82% of LOC.


*.md2252 LOC (68%) 66 files
*.json977 LOC (29%) 40 files
*.txt60 LOC (1%) 6 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)
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.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
  • *.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
  • *.cshtml files are analyzed with HtmlAnalyzer:
    • 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
  • *.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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.fs 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
  • *.avsc files are analyzed with JsonAnalyzer:
    • 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
  • *.proto 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
  • *.vb 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
  • *.fsproj 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
  • *.asax files are analyzed with HtmlAnalyzer:
    • 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


2025-05-04 14:24