microsoft / ProtocolTestFramework
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
xsd
txt
gitattributes
resx
targets
nuspec
  • 17 extensions are included in analyses: cs, ps1, csproj, sh, md, json, xsd, txt, html, css, gitignore, js, gitattributes, resx, targets, yml, nuspec
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (1 file).
    • exclude files with path like ".*[.]resx" (The resx resource 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 ".*[.]txt" (Text files) (1 file).
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.

main9709 LOC (82%) 75 files
test1298 LOC (11%) 24 files
generated53 LOC (<1%) 1 files
build and deployment164 LOC (1%) 5 files
other477 LOC (4%) 13 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 75 files match defined criteria (9,709 lines of code, 100.0% vs. main code):
    • 69 *.cs files (9,405 lines of code)
    • 2 *.html files (199 lines of code)
    • 1 *.css files (55 lines of code)
    • 1 *.yml files (25 lines of code)
    • 1 *.ps1 files (17 lines of code)
    • 1 *.targets files (8 lines of code)
  • " *.cs" is biggest, containing 96.87% of code.
  • " *.targets" is smallest, containing 0.08% of code.


*.cs9405 LOC (96%) 69 files
*.html199 LOC (2%) 2 files
*.css55 LOC (<1%) 1 files
*.yml25 LOC (<1%) 1 files
*.ps117 LOC (<1%) 1 files
*.targets8 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 ".*/UnitTests?/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 24 files match defined criteria (1,298 lines of code, 13.4% vs. main code):
    • 11 *.cs files (1,200 lines of code)
    • 1 *.csproj files (47 lines of code)
    • 7 *.ps1 files (41 lines of code)
    • 5 *.sh files (10 lines of code)
  • " *.cs" is biggest, containing 92.45% of code.
  • " *.sh" is smallest, containing 0.77% of code.


*.cs1200 LOC (92%) 11 files
*.csproj47 LOC (3%) 1 files
*.ps141 LOC (3%) 7 files
*.sh10 LOC (<1%) 5 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 "[/][/][ ]*".
  • 1 file matches defined criteria (53 lines of code, 0.5% vs. main code). All matches are in *.cs files.


*.cs53 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
nuspec
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 ".*[.]nuspec".
    • files with paths like ".*[.]sh".
  • 5 files match defined criteria (164 lines of code, 1.7% vs. main code):
    • 3 *.csproj files (112 lines of code)
    • 1 *.nuspec files (42 lines of code)
    • 1 *.sh files (10 lines of code)
  • " *.csproj" is biggest, containing 68.29% of code.
  • " *.sh" is smallest, containing 6.1% of code.


*.csproj112 LOC (68%) 3 files
*.nuspec42 LOC (25%) 1 files
*.sh10 LOC (6%) 1 files
Other Code
xsd
csproj
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 ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 13 files match defined criteria (477 lines of code, 4.9% vs. main code):
    • 2 *.xsd files (200 lines of code)
    • 4 *.cs files (139 lines of code)
    • 2 *.csproj files (62 lines of code)
    • 2 *.md files (52 lines of code)
    • 2 *.json files (16 lines of code)
    • 1 *.ps1 files (8 lines of code)
  • " *.xsd" is biggest, containing 41.93% of code.
  • " *.ps1" is smallest, containing 1.68% of code.


*.xsd200 LOC (41%) 2 files
*.cs139 LOC (29%) 4 files
*.csproj62 LOC (12%) 2 files
*.md52 LOC (10%) 2 files
*.json16 LOC (3%) 2 files
*.ps18 LOC (1%) 1 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)
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-30 10:25