microsoft / Windows-AppConsult-samples-PWA
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
csproj
jsproj
txt
gitattributes
dockerignore
pri
resx
editorconfig
cmd
  • 21 extensions are included in analyses: json, cs, js, cshtml, css, svg, html, ts, md, csproj, jsproj, gitignore, txt, yml, gitattributes, dockerignore, pri, resx, xml, editorconfig, cmd
  • 14 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (38 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (4 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (24 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) (4 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 ".*[.]resx" (The resx resource files) (2 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (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 ".*/bootstrap[-].*" (Library) (0 files).
    • exclude files with path like ".*[.]txt" (Text files) (5 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.

main36841 LOC (58%) 159 files
test123 LOC (<1%) 6 files
generated11599 LOC (18%) 3 files
build and deployment636 LOC (1%) 13 files
other13534 LOC (21%) 43 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cshtml
jsproj
cmd
pri
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 159 files match defined criteria (36,841 lines of code, 100.0% vs. main code):
    • 12 *.js files (18,268 lines of code)
    • 18 *.css files (14,518 lines of code)
    • 52 *.cs files (1,649 lines of code)
    • 36 *.cshtml files (1,098 lines of code)
    • 7 *.jsproj files (682 lines of code)
    • 17 *.html files (297 lines of code)
    • 12 *.ts files (190 lines of code)
    • 2 *.yml files (116 lines of code)
    • 1 *.cmd files (17 lines of code)
    • 2 *.pri files (6 lines of code)
  • " *.js" is biggest, containing 49.59% of code.
  • " *.pri" is smallest, containing 0.02% of code.


*.js18268 LOC (49%) 12 files
*.css14518 LOC (39%) 18 files
*.cs1649 LOC (4%) 52 files
*.cshtml1098 LOC (2%) 36 files
*.jsproj682 LOC (1%) 7 files
*.html297 LOC (<1%) 17 files
*.ts190 LOC (<1%) 12 files
*.yml116 LOC (<1%) 2 files
*.cmd17 LOC (<1%) 1 files
*.pri6 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/karma[.]conf[.]js".
    • files with paths like ".*/protractor[.]conf[.]js".
    • files with paths like ".*[.]spec[.]ts".
    • files with any line of content like ".*/simpletest/.*".
  • 6 files match defined criteria (123 lines of code, 0.3% vs. main code):
    • 4 *.ts files (69 lines of code)
    • 2 *.js files (54 lines of code)
  • " *.ts" is biggest, containing 56.1% of code.
  • " *.js" is smallest, containing 43.9% of code.


*.ts69 LOC (56%) 4 files
*.js54 LOC (43%) 2 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".
  • 3 files match defined criteria (11,599 lines of code, 31.5% vs. main code):
    • 1 *.json files (11,553 lines of code)
    • 2 *.cs files (46 lines of code)
  • " *.json" is biggest, containing 99.6% of code.
  • " *.cs" is smallest, containing 0.4% of code.


*.json11553 LOC (99%) 1 files
*.cs46 LOC (<1%) 2 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 ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 13 files match defined criteria (636 lines of code, 1.7% vs. main code):
    • 12 *.csproj files (626 lines of code)
    • 1 *.yml files (10 lines of code)
  • " *.csproj" is biggest, containing 98.43% of code.
  • " *.yml" is smallest, containing 1.57% of code.


*.csproj626 LOC (98%) 12 files
*.yml10 LOC (1%) 1 files
Other Code
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 ".*/[.]dockerignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 43 files match defined criteria (13,534 lines of code, 36.7% vs. main code):
    • 27 *.json files (12,459 lines of code)
    • 1 *.xml files (818 lines of code)
    • 15 *.md files (257 lines of code)
  • " *.json" is biggest, containing 92.06% of code.
  • " *.md" is smallest, containing 1.9% of code.


*.json12459 LOC (92%) 27 files
*.xml818 LOC (6%) 1 files
*.md257 LOC (1%) 15 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.jsproj 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
  • *.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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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
  • *.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
  • *.pri 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


2022-01-30 20:03