microsoft / testfx
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
xlf
props
targets
nuspec
txt
cmd
patch
proj
resx
shproj
gitattributes
fs
DotSettings
cmake
fsproj
  • 26 extensions are included in analyses: cs, csproj, xlf, ps1, yml, sh, props, xml, targets, md, nuspec, txt, cmd, json, patch, proj, resx, shproj, gitattributes, fs, psm1, DotSettings, psd1, gitignore, cmake, fsproj
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (4 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (3 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 ".*[.]txt" (Text files) (4 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.

main40544 LOC (57%) 407 files
test24188 LOC (34%) 215 files
generated873 LOC (1%) 3 files
build and deployment4233 LOC (6%) 39 files
other441 LOC (<1%) 24 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xlf
props
cmake
targets
proj
shproj
cmd
dotsettings
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 407 files match defined criteria (40,544 lines of code, 100.0% vs. main code):
    • 261 *.cs files (21,733 lines of code)
    • 42 *.xlf files (10,597 lines of code)
    • 36 *.ps1 files (4,275 lines of code)
    • 35 *.yml files (2,676 lines of code)
    • 12 *.props files (385 lines of code)
    • 1 *.psm1 files (343 lines of code)
    • 1 *.cmake files (215 lines of code)
    • 7 *.targets files (189 lines of code)
    • 3 *.proj files (74 lines of code)
    • 2 *.shproj files (24 lines of code)
    • 5 *.cmd files (15 lines of code)
    • 1 *.psd1 files (11 lines of code)
    • 1 *.dotsettings files (7 lines of code)
  • " *.cs" is biggest, containing 53.6% of code.
  • " *.dotsettings" is smallest, containing 0.02% of code.


*.cs21733 LOC (53%) 261 files
*.xlf10597 LOC (26%) 42 files
*.ps14275 LOC (10%) 36 files
*.yml2676 LOC (6%) 35 files
*.props385 LOC (<1%) 12 files
*.psm1343 LOC (<1%) 1 files
*.cmake215 LOC (<1%) 1 files
*.targets189 LOC (<1%) 7 files
*.proj74 LOC (<1%) 3 files
*.shproj24 LOC (<1%) 2 files
*.cmd15 LOC (<1%) 5 files
*.psd111 LOC (<1%) 1 files
*.dotsettings7 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
targets
fsproj
fs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/UnitTests?/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 215 files match defined criteria (24,188 lines of code, 59.7% vs. main code):
    • 179 *.cs files (22,446 lines of code)
    • 32 *.csproj files (1,699 lines of code)
    • 2 *.targets files (18 lines of code)
    • 1 *.fsproj files (17 lines of code)
    • 1 *.fs files (8 lines of code)
  • " *.cs" is biggest, containing 92.8% of code.
  • " *.fs" is smallest, containing 0.03% of code.


*.cs22446 LOC (92%) 179 files
*.csproj1699 LOC (7%) 32 files
*.targets18 LOC (<1%) 2 files
*.fsproj17 LOC (<1%) 1 files
*.fs8 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 "[/][/][ ]*".
  • 3 files match defined criteria (873 lines of code, 2.2% vs. main code). All matches are in *.cs files.


*.cs873 LOC (100%) 3 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 ".*[.]sh".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
  • 39 files match defined criteria (4,233 lines of code, 10.4% vs. main code):
    • 20 *.sh files (2,565 lines of code)
    • 14 *.csproj files (1,343 lines of code)
    • 5 *.nuspec files (325 lines of code)
  • " *.sh" is biggest, containing 60.6% of code.
  • " *.nuspec" is smallest, containing 7.68% of code.


*.sh2565 LOC (60%) 20 files
*.csproj1343 LOC (31%) 14 files
*.nuspec325 LOC (7%) 5 files
Other Code
patch
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • 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)".
  • 24 files match defined criteria (441 lines of code, 1.1% vs. main code):
    • 10 *.xml files (126 lines of code)
    • 4 *.md files (73 lines of code)
    • 3 *.json files (69 lines of code)
    • 3 *.cs files (66 lines of code)
    • 3 *.patch files (61 lines of code)
    • 1 *.csproj files (46 lines of code)
  • " *.xml" is biggest, containing 28.57% of code.
  • " *.csproj" is smallest, containing 10.43% of code.


*.xml126 LOC (28%) 10 files
*.md73 LOC (16%) 4 files
*.json69 LOC (15%) 3 files
*.cs66 LOC (14%) 3 files
*.patch61 LOC (13%) 3 files
*.csproj46 LOC (10%) 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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.dotsettings 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 13:50