microsoft / plcrashreporter
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
S
s
plist
txt
proto
tex
sty
podspec
  • 21 extensions are included in analyses: h, m, c, S, mm, s, cpp, sh, hpp, plist, md, yml, txt, xib, proto, json, swift, tex, sty, podspec, gitignore
  • 3 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 ".*/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).
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.

main19136 LOC (47%) 161 files
test18124 LOC (44%) 81 files
generated413 LOC (1%) 2 files
build and deployment140 LOC (<1%) 9 files
other2767 LOC (6%) 20 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
s
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 161 files match defined criteria (19,136 lines of code, 100.0% vs. main code):
    • 21 *.c files (7,750 lines of code)
    • 36 *.m files (3,591 lines of code)
    • 80 *.h files (3,144 lines of code)
    • 10 *.cpp files (2,120 lines of code)
    • 9 *.hpp files (1,055 lines of code)
    • 2 *.mm files (901 lines of code)
    • 1 *.proto files (291 lines of code)
    • 1 *.s files (240 lines of code)
    • 1 *.swift files (44 lines of code)
  • " *.c" is biggest, containing 40.5% of code.
  • " *.swift" is smallest, containing 0.23% of code.


*.c7750 LOC (40%) 21 files
*.m3591 LOC (18%) 36 files
*.h3144 LOC (16%) 80 files
*.cpp2120 LOC (11%) 10 files
*.hpp1055 LOC (5%) 9 files
*.mm901 LOC (4%) 2 files
*.proto291 LOC (1%) 1 files
*.s240 LOC (1%) 1 files
*.swift44 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
s
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
  • 81 files match defined criteria (18,124 lines of code, 94.7% vs. main code):
    • 28 *.s files (11,357 lines of code)
    • 31 *.m files (3,659 lines of code)
    • 10 *.mm files (2,135 lines of code)
    • 5 *.c files (763 lines of code)
    • 5 *.h files (138 lines of code)
    • 1 *.proto files (50 lines of code)
    • 1 *.sh files (22 lines of code)
  • " *.s" is biggest, containing 62.66% of code.
  • " *.sh" is smallest, containing 0.12% of code.


*.s11357 LOC (62%) 28 files
*.m3659 LOC (20%) 31 files
*.mm2135 LOC (11%) 10 files
*.c763 LOC (4%) 5 files
*.h138 LOC (<1%) 5 files
*.proto50 LOC (<1%) 1 files
*.sh22 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 ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
  • 2 files match defined criteria (413 lines of code, 2.2% vs. main code). All matches are in *.h files.


*.h413 LOC (100%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
podspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]podspec".
    • files with paths like ".*[.]sh".
  • 9 files match defined criteria (140 lines of code, 0.7% vs. main code):
    • 8 *.sh files (124 lines of code)
    • 1 *.podspec files (16 lines of code)
  • " *.sh" is biggest, containing 88.57% of code.
  • " *.podspec" is smallest, containing 11.43% of code.


*.sh124 LOC (88%) 8 files
*.podspec16 LOC (11%) 1 files
Other Code
sty
plist
txt
tex
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]xib".
  • 20 files match defined criteria (2,767 lines of code, 14.5% vs. main code):
    • 1 *.sty files (1,636 lines of code)
    • 3 *.xib files (393 lines of code)
    • 8 *.plist files (318 lines of code)
    • 2 *.md files (237 lines of code)
    • 3 *.txt files (73 lines of code)
    • 2 *.json files (73 lines of code)
    • 1 *.tex files (37 lines of code)
  • " *.sty" is biggest, containing 59.13% of code.
  • " *.tex" is smallest, containing 1.34% of code.


*.sty1636 LOC (59%) 1 files
*.xib393 LOC (14%) 3 files
*.plist318 LOC (11%) 8 files
*.md237 LOC (8%) 2 files
*.txt73 LOC (2%) 3 files
*.json73 LOC (2%) 2 files
*.tex37 LOC (1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
    • No dependency analysis
  • *.m 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
  • *.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
  • *.hpp 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
  • *.mm 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
  • *.proto 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
  • *.s 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
  • *.swift files are analyzed with SwiftAnalyzer:
    • 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
    • No dependency analysis


2022-01-30 07:30