microsoft / calculator
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
xaml
vcxproj
filters
csproj
targets
txt
gitattributes
editorconfig
nuspec
clang-format
props
  • 21 extensions are included in analyses: h, cpp, cs, xaml, md, yaml, vcxproj, filters, ps1, csproj, targets, xml, json, txt, gitattributes, sh, editorconfig, nuspec, gitignore, clang-format, props
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (4 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) (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.

main59461 LOC (84%) 328 files
test9948 LOC (14%) 39 files
generated0 LOC (0%) 0 files
build and deployment921 LOC (1%) 5 files
other325 LOC (<1%) 7 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xaml
vcxproj
filters
targets
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 328 files match defined criteria (59,461 lines of code, 100.0% vs. main code):
    • 78 *.cpp files (18,205 lines of code)
    • 28 *.xaml files (13,990 lines of code)
    • 88 *.cs files (13,853 lines of code)
    • 106 *.h files (9,753 lines of code)
    • 6 *.vcxproj files (2,128 lines of code)
    • 6 *.filters files (751 lines of code)
    • 10 *.yaml files (542 lines of code)
    • 3 *.ps1 files (181 lines of code)
    • 2 *.targets files (52 lines of code)
    • 1 *.props files (6 lines of code)
  • " *.cpp" is biggest, containing 30.62% of code.
  • " *.props" is smallest, containing 0.01% of code.


*.cpp18205 LOC (30%) 78 files
*.xaml13990 LOC (23%) 28 files
*.cs13853 LOC (23%) 88 files
*.h9753 LOC (16%) 106 files
*.vcxproj2128 LOC (3%) 6 files
*.filters751 LOC (1%) 6 files
*.yaml542 LOC (<1%) 10 files
*.ps1181 LOC (<1%) 3 files
*.targets52 LOC (<1%) 2 files
*.props6 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
vcxproj
filters
xaml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/Mocks/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 39 files match defined criteria (9,948 lines of code, 16.7% vs. main code):
    • 23 *.cpp files (8,483 lines of code)
    • 13 *.h files (1,082 lines of code)
    • 1 *.vcxproj files (293 lines of code)
    • 1 *.filters files (85 lines of code)
    • 1 *.xaml files (5 lines of code)
  • " *.cpp" is biggest, containing 85.27% of code.
  • " *.xaml" is smallest, containing 0.05% of code.


*.cpp8483 LOC (85%) 23 files
*.h1082 LOC (10%) 13 files
*.vcxproj293 LOC (2%) 1 files
*.filters85 LOC (<1%) 1 files
*.xaml5 LOC (<1%) 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 ".*[.]nuspec".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]csproj".
  • 5 files match defined criteria (921 lines of code, 1.5% vs. main code):
    • 3 *.csproj files (869 lines of code)
    • 1 *.sh files (37 lines of code)
    • 1 *.nuspec files (15 lines of code)
  • " *.csproj" is biggest, containing 94.35% of code.
  • " *.nuspec" is smallest, containing 1.63% of code.


*.csproj869 LOC (94%) 3 files
*.sh37 LOC (4%) 1 files
*.nuspec15 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 ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 7 files match defined criteria (325 lines of code, 0.5% vs. main code):
    • 4 *.md files (182 lines of code)
    • 1 *.json files (134 lines of code)
    • 2 *.xml files (9 lines of code)
  • " *.md" is biggest, containing 56% of code.
  • " *.xml" is smallest, containing 2.77% of code.


*.md182 LOC (56%) 4 files
*.json134 LOC (41%) 1 files
*.xml9 LOC (2%) 2 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
  • *.xaml 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
  • *.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)
  • *.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
  • *.yaml 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
  • *.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


2022-01-30 23:55