microsoft / PartsUnlimited
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
cshtml
txt
csproj
xaml
targets
plist
axml
gitattributes
dockerignore
DotSettings
  • 26 extensions are included in analyses: cs, cshtml, json, ps1, js, txt, csproj, scss, yml, svg, xaml, css, targets, xml, md, plist, bat, html, axml, gitattributes, dockerignore, psm1, DotSettings, yaml, gitignore, groovy
  • 12 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (1 file).
    • exclude files with path like ".*/dist/.*" (Distributions) (6 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (0 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (1 file).
    • 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) (0 files).
    • exclude files with path like ".*[.]txt" (Text files) (11 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.

main12169 LOC (41%) 238 files
test336 LOC (1%) 6 files
generated5788 LOC (19%) 2 files
build and deployment880 LOC (3%) 14 files
other10144 LOC (34%) 63 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cshtml
targets
xaml
axml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 238 files match defined criteria (12,169 lines of code, 100.0% vs. main code):
    • 117 *.cs files (6,310 lines of code)
    • 68 *.cshtml files (2,463 lines of code)
    • 6 *.scss files (1,389 lines of code)
    • 26 *.ps1 files (1,201 lines of code)
    • 1 *.psm1 files (337 lines of code)
    • 6 *.js files (124 lines of code)
    • 2 *.targets files (113 lines of code)
    • 1 *.yaml files (78 lines of code)
    • 5 *.xaml files (77 lines of code)
    • 2 *.css files (24 lines of code)
    • 1 *.groovy files (23 lines of code)
    • 2 *.axml files (19 lines of code)
    • 1 *.yml files (11 lines of code)
  • " *.cs" is biggest, containing 51.85% of code.
  • " *.yml" is smallest, containing 0.09% of code.


*.cs6310 LOC (51%) 117 files
*.cshtml2463 LOC (20%) 68 files
*.scss1389 LOC (11%) 6 files
*.ps11201 LOC (9%) 26 files
*.psm1337 LOC (2%) 1 files
*.js124 LOC (1%) 6 files
*.targets113 LOC (<1%) 2 files
*.yaml78 LOC (<1%) 1 files
*.xaml77 LOC (<1%) 5 files
*.css24 LOC (<1%) 2 files
*.groovy23 LOC (<1%) 1 files
*.axml19 LOC (<1%) 2 files
*.yml11 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]est/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 6 files match defined criteria (336 lines of code, 2.8% vs. main code):
    • 5 *.cs files (313 lines of code)
    • 1 *.csproj files (23 lines of code)
  • " *.cs" is biggest, containing 93.15% of code.
  • " *.csproj" is smallest, containing 6.85% of code.


*.cs313 LOC (93%) 5 files
*.csproj23 LOC (6%) 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 "[/][/][ ]*".
    • files with paths like ".*/package[-]lock[.]json".
  • 2 files match defined criteria (5,788 lines of code, 47.6% vs. main code):
    • 1 *.json files (3,437 lines of code)
    • 1 *.cs files (2,351 lines of code)
  • " *.json" is biggest, containing 59.38% of code.
  • " *.cs" is smallest, containing 40.62% of code.


*.json3437 LOC (59%) 1 files
*.cs2351 LOC (40%) 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 ".*[.]csproj".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 14 files match defined criteria (880 lines of code, 7.2% vs. main code):
    • 9 *.csproj files (850 lines of code)
    • 3 *.yml files (22 lines of code)
    • 2 *.bat files (8 lines of code)
  • " *.csproj" is biggest, containing 96.59% of code.
  • " *.bat" is smallest, containing 0.91% of code.


*.csproj850 LOC (96%) 9 files
*.yml22 LOC (2%) 3 files
*.bat8 LOC (<1%) 2 files
Other Code
targets
plist
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 ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 63 files match defined criteria (10,144 lines of code, 83.4% vs. main code):
    • 48 *.json files (9,685 lines of code)
    • 2 *.ps1 files (157 lines of code)
    • 1 *.targets files (104 lines of code)
    • 3 *.md files (65 lines of code)
    • 2 *.plist files (62 lines of code)
    • 2 *.yml files (28 lines of code)
    • 3 *.xml files (27 lines of code)
    • 2 *.html files (16 lines of code)
  • " *.json" is biggest, containing 95.48% of code.
  • " *.html" is smallest, containing 0.16% of code.


*.json9685 LOC (95%) 48 files
*.ps1157 LOC (1%) 2 files
*.targets104 LOC (1%) 1 files
*.md65 LOC (<1%) 3 files
*.plist62 LOC (<1%) 2 files
*.yml28 LOC (<1%) 2 files
*.xml27 LOC (<1%) 3 files
*.html16 LOC (<1%) 2 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)
  • *.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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.xaml 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
  • *.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
  • *.groovy files are analyzed with GroovyAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.axml 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
  • *.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


2022-01-30 09:50