microsoft / dotnet-framework-docker
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
aspx
cshtml
dockerignore
asax
gitattributes
ascx
editorconfig
txt
  • 19 extensions are included in analyses: cs, yml, js, md, csproj, ps1, css, aspx, sh, cshtml, json, dockerignore, asax, svg, gitattributes, ascx, editorconfig, gitignore, txt
  • 11 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (4 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (5 files).
    • exclude files with path like ".*/modernizr\-\d\.\d+(\.\d+)?\.js" (Modernizr) (2 files).
    • exclude files with path like ".*/jquery([^.]*)\.validate(\.unobtrusive)?\.js" (jQuery validation plugin (MS bundles this with asp.net mvc)) (0 files).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 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 ".*/bootstrap[-].*" (Library) (2 files).
    • exclude files with path like ".*[.]txt" (Text files) (0 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.

main1828 LOC (13%) 57 files
test2926 LOC (21%) 66 files
generated42 LOC (<1%) 6 files
build and deployment417 LOC (3%) 7 files
other8373 LOC (61%) 105 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 57 files match defined criteria (1,828 lines of code, 100.0% vs. main code):
    • 42 *.yml files (1,154 lines of code)
    • 10 *.ps1 files (368 lines of code)
    • 5 *.cs files (306 lines of code)
  • " *.yml" is biggest, containing 63.13% of code.
  • " *.cs" is smallest, containing 16.74% of code.


*.yml1154 LOC (63%) 42 files
*.ps1368 LOC (20%) 10 files
*.cs306 LOC (16%) 5 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
aspx
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 66 files match defined criteria (2,926 lines of code, 160.1% vs. main code):
    • 41 *.cs files (1,411 lines of code)
    • 15 *.csproj files (938 lines of code)
    • 3 *.yml files (394 lines of code)
    • 6 *.aspx files (114 lines of code)
    • 1 *.ps1 files (69 lines of code)
  • " *.cs" is biggest, containing 48.22% of code.
  • " *.ps1" is smallest, containing 2.36% of code.


*.cs1411 LOC (48%) 41 files
*.csproj938 LOC (32%) 15 files
*.yml394 LOC (13%) 3 files
*.aspx114 LOC (3%) 6 files
*.ps169 LOC (2%) 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 ".*[.]designer[.](cs|vb)".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 6 files match defined criteria (42 lines of code, 2.3% vs. main code). All matches are in *.cs files.


*.cs42 LOC (100%) 6 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".
  • 7 files match defined criteria (417 lines of code, 22.8% vs. main code):
    • 6 *.sh files (402 lines of code)
    • 1 *.csproj files (15 lines of code)
  • " *.sh" is biggest, containing 96.4% of code.
  • " *.csproj" is smallest, containing 3.6% of code.


*.sh402 LOC (96%) 6 files
*.csproj15 LOC (3%) 1 files
Other Code
csproj
cshtml
aspx
ascx
asax
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
  • 105 files match defined criteria (8,373 lines of code, 458.0% vs. main code):
    • 12 *.js files (4,608 lines of code)
    • 32 *.md files (1,124 lines of code)
    • 4 *.json files (1,054 lines of code)
    • 6 *.csproj files (749 lines of code)
    • 35 *.cs files (574 lines of code)
    • 6 *.cshtml files (133 lines of code)
    • 3 *.aspx files (59 lines of code)
    • 2 *.css files (38 lines of code)
    • 2 *.yml files (28 lines of code)
    • 1 *.ascx files (4 lines of code)
    • 2 *.asax files (2 lines of code)
  • " *.js" is biggest, containing 55.03% of code.
  • " *.asax" is smallest, containing 0.02% of code.


*.js4608 LOC (55%) 12 files
*.md1124 LOC (13%) 32 files
*.json1054 LOC (12%) 4 files
*.csproj749 LOC (8%) 6 files
*.cs574 LOC (6%) 35 files
*.cshtml133 LOC (1%) 6 files
*.aspx59 LOC (<1%) 3 files
*.css38 LOC (<1%) 2 files
*.yml28 LOC (<1%) 2 files
*.ascx4 LOC (<1%) 1 files
*.asax2 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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)


2022-01-30 14:01