microsoft / vstest
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
xlf
txt
csproj
resx
nuspec
props
targets
cmd
proj
patch
vcxproj
filters
editorconfig
shproj
vsixmanifest
gitattributes
fs
cmake
xslt
  • 34 extensions are included in analyses: cs, xlf, txt, csproj, ps1, yml, sh, json, resx, nuspec, props, targets, xml, md, cmd, proj, patch, cpp, h, vcxproj, filters, psm1, editorconfig, shproj, html, psd1, vb, vsixmanifest, js, gitattributes, fs, gitignore, cmake, xslt
  • 7 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 ".*[.]resx" (The resx resource files) (18 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (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) (199 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.

main101706 LOC (24%) 1061 files
test308606 LOC (73%) 518 files
generated2852 LOC (<1%) 18 files
build and deployment7228 LOC (1%) 69 files
other2352 LOC (<1%) 54 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xlf
proj
targets
props
cmake
xslt
vsixmanifest
cmd
shproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1061 files match defined criteria (101,706 lines of code, 100.0% vs. main code):
    • 708 *.cs files (53,794 lines of code)
    • 252 *.xlf files (37,864 lines of code)
    • 39 *.ps1 files (5,676 lines of code)
    • 30 *.yml files (2,501 lines of code)
    • 4 *.proj files (485 lines of code)
    • 1 *.psm1 files (343 lines of code)
    • 7 *.targets files (312 lines of code)
    • 9 *.props files (242 lines of code)
    • 1 *.cmake files (215 lines of code)
    • 1 *.xslt files (206 lines of code)
    • 1 *.vsixmanifest files (27 lines of code)
    • 6 *.cmd files (17 lines of code)
    • 1 *.shproj files (13 lines of code)
    • 1 *.psd1 files (11 lines of code)
  • " *.cs" is biggest, containing 52.89% of code.
  • " *.psd1" is smallest, containing 0.01% of code.


*.cs53794 LOC (52%) 708 files
*.xlf37864 LOC (37%) 252 files
*.ps15676 LOC (5%) 39 files
*.yml2501 LOC (2%) 30 files
*.proj485 LOC (<1%) 4 files
*.psm1343 LOC (<1%) 1 files
*.targets312 LOC (<1%) 7 files
*.props242 LOC (<1%) 9 files
*.cmake215 LOC (<1%) 1 files
*.xslt206 LOC (<1%) 1 files
*.vsixmanifest27 LOC (<1%) 1 files
*.cmd17 LOC (<1%) 6 files
*.shproj13 LOC (<1%) 1 files
*.psd111 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
vcxproj
nuspec
filters
proj
targets
props
fs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 518 files match defined criteria (308,606 lines of code, 303.4% vs. main code):
    • 421 *.cs files (305,926 lines of code)
    • 74 *.csproj files (1,966 lines of code)
    • 2 *.vcxproj files (334 lines of code)
    • 3 *.nuspec files (108 lines of code)
    • 2 *.filters files (66 lines of code)
    • 1 *.html files (58 lines of code)
    • 1 *.proj files (55 lines of code)
    • 2 *.targets files (28 lines of code)
    • 4 *.cpp files (25 lines of code)
    • 4 *.h files (11 lines of code)
    • 1 *.vb files (9 lines of code)
    • 1 *.props files (9 lines of code)
    • 1 *.js files (6 lines of code)
    • 1 *.fs files (5 lines of code)
  • " *.cs" is biggest, containing 99.13% of code.
  • " *.fs" is smallest, containing 0% of code.


*.cs305926 LOC (99%) 421 files
*.csproj1966 LOC (<1%) 74 files
*.vcxproj334 LOC (<1%) 2 files
*.nuspec108 LOC (<1%) 3 files
*.filters66 LOC (<1%) 2 files
*.html58 LOC (<1%) 1 files
*.proj55 LOC (<1%) 1 files
*.targets28 LOC (<1%) 2 files
*.cpp25 LOC (<1%) 4 files
*.h11 LOC (<1%) 4 files
*.vb9 LOC (<1%) 1 files
*.props9 LOC (<1%) 1 files
*.js6 LOC (<1%) 1 files
*.fs5 LOC (<1%) 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 "[/][/][ ]*".
  • 18 files match defined criteria (2,852 lines of code, 2.8% vs. main code). All matches are in *.cs files.


*.cs2852 LOC (100%) 18 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
nuspec
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".
    • files with paths like ".*[.]nuspec".
  • 69 files match defined criteria (7,228 lines of code, 7.1% vs. main code):
    • 26 *.sh files (3,168 lines of code)
    • 11 *.nuspec files (2,273 lines of code)
    • 32 *.csproj files (1,787 lines of code)
  • " *.sh" is biggest, containing 43.83% of code.
  • " *.csproj" is smallest, containing 24.72% of code.


*.sh3168 LOC (43%) 26 files
*.nuspec2273 LOC (31%) 11 files
*.csproj1787 LOC (24%) 32 files
Other Code
csproj
patch
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 54 files match defined criteria (2,352 lines of code, 2.3% vs. main code):
    • 14 *.cs files (868 lines of code)
    • 8 *.xml files (604 lines of code)
    • 19 *.json files (535 lines of code)
    • 4 *.csproj files (139 lines of code)
    • 5 *.md files (104 lines of code)
    • 4 *.patch files (102 lines of code)
  • " *.cs" is biggest, containing 36.9% of code.
  • " *.patch" is smallest, containing 4.34% of code.


*.cs868 LOC (36%) 14 files
*.xml604 LOC (25%) 8 files
*.json535 LOC (22%) 19 files
*.csproj139 LOC (5%) 4 files
*.md104 LOC (4%) 5 files
*.patch102 LOC (4%) 4 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)
  • *.xlf 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
  • *.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
  • *.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
  • *.proj 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
  • *.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
  • *.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
  • *.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
  • *.cmake 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
  • *.xslt 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
  • *.vsixmanifest 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
  • *.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
  • *.shproj 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
  • *.psd1 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 13:47