microsoft / vswhere
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
props
filters
txt
vcxproj
gitattributes
nuspec
cmd
  • 15 extensions are included in analyses: h, cpp, json, yml, props, ps1, gitignore, filters, txt, vcxproj, md, dockerfile, gitattributes, nuspec, cmd
  • 5 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 ".*/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) (2 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.

main4342 LOC (42%) 65 files
test5289 LOC (51%) 32 files
generated0 LOC (0%) 0 files
build and deployment78 LOC (<1%) 3 files
other465 LOC (4%) 9 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
filters
props
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 65 files match defined criteria (4,342 lines of code, 100.0% vs. main code):
    • 22 *.cpp files (2,360 lines of code)
    • 29 *.h files (1,173 lines of code)
    • 2 *.vcxproj files (318 lines of code)
    • 2 *.filters files (209 lines of code)
    • 3 *.yml files (121 lines of code)
    • 1 *.ps1 files (81 lines of code)
    • 5 *.props files (76 lines of code)
    • 1 *.cmd files (4 lines of code)
  • " *.cpp" is biggest, containing 54.35% of code.
  • " *.cmd" is smallest, containing 0.09% of code.


*.cpp2360 LOC (54%) 22 files
*.h1173 LOC (27%) 29 files
*.vcxproj318 LOC (7%) 2 files
*.filters209 LOC (4%) 2 files
*.yml121 LOC (2%) 3 files
*.ps181 LOC (1%) 1 files
*.props76 LOC (1%) 5 files
*.cmd4 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
vcxproj
filters
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*[.]tests[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 32 files match defined criteria (5,289 lines of code, 121.8% vs. main code):
    • 16 *.cpp files (3,542 lines of code)
    • 11 *.h files (939 lines of code)
    • 3 *.ps1 files (530 lines of code)
    • 1 *.vcxproj files (173 lines of code)
    • 1 *.filters files (105 lines of code)
  • " *.cpp" is biggest, containing 66.97% of code.
  • " *.filters" is smallest, containing 1.99% of code.


*.cpp3542 LOC (66%) 16 files
*.h939 LOC (17%) 11 files
*.ps1530 LOC (10%) 3 files
*.vcxproj173 LOC (3%) 1 files
*.filters105 LOC (1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*[.]dockerfile".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*[.]nuspec".
  • 3 files match defined criteria (78 lines of code, 1.8% vs. main code):
    • 1 *.dockerfile files (32 lines of code)
    • 1 *.nuspec files (30 lines of code)
    • 1 *.yml files (16 lines of code)
  • " *.dockerfile" is biggest, containing 41.03% of code.
  • " *.yml" is smallest, containing 20.51% of code.


*.dockerfile32 LOC (41%) 1 files
*.nuspec30 LOC (38%) 1 files
*.yml16 LOC (20%) 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 ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
  • 9 files match defined criteria (465 lines of code, 10.7% vs. main code):
    • 6 *.json files (372 lines of code)
    • 3 *.md files (93 lines of code)
  • " *.json" is biggest, containing 80% of code.
  • " *.md" is smallest, containing 20% of code.


*.json372 LOC (80%) 6 files
*.md93 LOC (20%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.cpp files are analyzed with CppAnalyzer:
    • 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
  • *.h files are analyzed with CppAnalyzer:
    • 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
  • *.vcxproj 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
  • *.filters 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
  • *.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
  • *.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
  • *.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


2022-01-30 14:32