microsoft / service-fabric
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
txt
csproj
props
cfg
cmd
proj
inl
ini
targets
resx
man
gitattributes
dockerignore
spec
mk
xsd
cdf
csdef
sfproj
cscfg
awk
cmake
  • 44 extensions are included in analyses: h, cpp, cs, txt, json, xml, csproj, sh, props, cfg, cmd, md, c, proj, inl, ps1, ini, pl, targets, resx, bat, man, js, gitignore, yml, py, ps1xml, gitattributes, dockerignore, spec, mk, psd1, xsd, cc, pm, css, html, cdf, csdef, sfproj, cscfg, hpp, awk, cmake
  • 11 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (19 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (5 files).
    • exclude files with path like ".*/debian/.*" (Distributions) (3 files).
    • exclude files with path like ".*/dependencies/.*" (Dependencies) (9 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (14 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (1 file).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (15 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) (530 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.

main2093274 LOC (73%) 14259 files
test545885 LOC (19%) 2108 files
generated76056 LOC (2%) 20 files
build and deployment23914 LOC (<1%) 260 files
other97336 LOC (3%) 816 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
man
inl
props
targets
cmd
proj
cfg
spec
sfproj
csdef
awk
cscfg
cdf
cmake
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 14259 files match defined criteria (2,093,274 lines of code, 100.0% vs. main code):
    • 4,122 *.cpp files (992,051 lines of code)
    • 5,665 *.h files (549,637 lines of code)
    • 4,217 *.cs files (493,414 lines of code)
    • 46 *.c files (22,670 lines of code)
    • 5 *.man files (14,403 lines of code)
    • 20 *.inl files (8,539 lines of code)
    • 4 *.ps1xml files (4,997 lines of code)
    • 69 *.props files (2,241 lines of code)
    • 11 *.pl files (1,684 lines of code)
    • 11 *.ps1 files (1,078 lines of code)
    • 8 *.js files (488 lines of code)
    • 13 *.targets files (456 lines of code)
    • 3 *.py files (347 lines of code)
    • 27 *.cmd files (332 lines of code)
    • 16 *.proj files (277 lines of code)
    • 1 *.html files (193 lines of code)
    • 2 *.psd1 files (116 lines of code)
    • 1 *.yml files (62 lines of code)
    • 1 *.pm files (57 lines of code)
    • 8 *.cfg files (52 lines of code)
    • 2 *.spec files (48 lines of code)
    • 1 *.sfproj files (41 lines of code)
    • 1 *.csdef files (28 lines of code)
    • 1 *.awk files (16 lines of code)
    • 1 *.cscfg files (13 lines of code)
    • 1 *.cdf files (12 lines of code)
    • 1 *.cmake files (12 lines of code)
    • 1 *.hpp files (10 lines of code)
  • " *.cpp" is biggest, containing 47.39% of code.
  • " *.hpp" is smallest, containing 0% of code.


*.cpp992051 LOC (47%) 4122 files
*.h549637 LOC (26%) 5665 files
*.cs493414 LOC (23%) 4217 files
*.c22670 LOC (1%) 46 files
*.man14403 LOC (<1%) 5 files
*.inl8539 LOC (<1%) 20 files
*.ps1xml4997 LOC (<1%) 4 files
*.props2241 LOC (<1%) 69 files
*.pl1684 LOC (<1%) 11 files
*.ps11078 LOC (<1%) 11 files
*.js488 LOC (<1%) 8 files
*.targets456 LOC (<1%) 13 files
*.py347 LOC (<1%) 3 files
*.cmd332 LOC (<1%) 27 files
*.proj277 LOC (<1%) 16 files
*.html193 LOC (<1%) 1 files
*.psd1116 LOC (<1%) 2 files
*.yml62 LOC (<1%) 1 files
*.pm57 LOC (<1%) 1 files
*.cfg52 LOC (<1%) 8 files
*.spec48 LOC (<1%) 2 files
*.sfproj41 LOC (<1%) 1 files
*.csdef28 LOC (<1%) 1 files
*.awk16 LOC (<1%) 1 files
*.cscfg13 LOC (<1%) 1 files
*.cdf12 LOC (<1%) 1 files
*.cmake12 LOC (<1%) 1 files
*.hpp10 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
cmd
cfg
man
proj
targets
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 2108 files match defined criteria (545,885 lines of code, 26.1% vs. main code):
    • 860 *.cpp files (419,699 lines of code)
    • 518 *.cs files (93,419 lines of code)
    • 533 *.h files (23,117 lines of code)
    • 51 *.csproj files (5,229 lines of code)
    • 25 *.cmd files (1,410 lines of code)
    • 49 *.cfg files (1,094 lines of code)
    • 23 *.sh files (613 lines of code)
    • 4 *.man files (488 lines of code)
    • 30 *.proj files (379 lines of code)
    • 6 *.ps1 files (175 lines of code)
    • 4 *.yml files (158 lines of code)
    • 1 *.py files (68 lines of code)
    • 1 *.targets files (19 lines of code)
    • 3 *.props files (17 lines of code)
  • " *.cpp" is biggest, containing 76.88% of code.
  • " *.props" is smallest, containing 0% of code.


*.cpp419699 LOC (76%) 860 files
*.cs93419 LOC (17%) 518 files
*.h23117 LOC (4%) 533 files
*.csproj5229 LOC (<1%) 51 files
*.cmd1410 LOC (<1%) 25 files
*.cfg1094 LOC (<1%) 49 files
*.sh613 LOC (<1%) 23 files
*.man488 LOC (<1%) 4 files
*.proj379 LOC (<1%) 30 files
*.ps1175 LOC (<1%) 6 files
*.yml158 LOC (<1%) 4 files
*.py68 LOC (<1%) 1 files
*.targets19 LOC (<1%) 1 files
*.props17 LOC (<1%) 3 files
Generated Code
Automatically generated files, not manually changed after generation.
cmd
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.](cpp|hpp|h|cc)" AND any line of content like ".*[/][/] Generated by the gRPC.*".
    • 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[!].*".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
    • files with paths like ".*/generated/.*".
  • 20 files match defined criteria (76,056 lines of code, 3.6% vs. main code):
    • 2 *.cc files (32,538 lines of code)
    • 7 *.cs files (22,631 lines of code)
    • 2 *.h files (19,911 lines of code)
    • 3 *.pl files (565 lines of code)
    • 3 *.cmd files (277 lines of code)
    • 2 *.csproj files (77 lines of code)
    • 1 *.pm files (57 lines of code)
  • " *.cc" is biggest, containing 42.78% of code.
  • " *.pm" is smallest, containing 0.07% of code.


*.cc32538 LOC (42%) 2 files
*.cs22631 LOC (29%) 7 files
*.h19911 LOC (26%) 2 files
*.pl565 LOC (<1%) 3 files
*.cmd277 LOC (<1%) 3 files
*.csproj77 LOC (<1%) 2 files
*.pm57 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
mk
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 ".*[.]bat".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]mk".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/docker[-]compose[.]yml".
  • 260 files match defined criteria (23,914 lines of code, 1.1% vs. main code):
    • 182 *.csproj files (20,282 lines of code)
    • 63 *.sh files (3,462 lines of code)
    • 2 *.mk files (104 lines of code)
    • 13 *.bat files (66 lines of code)
  • " *.csproj" is biggest, containing 84.81% of code.
  • " *.bat" is smallest, containing 0.28% of code.


*.csproj20282 LOC (84%) 182 files
*.sh3462 LOC (14%) 63 files
*.mk104 LOC (<1%) 2 files
*.bat66 LOC (<1%) 13 files
Other Code
xsd
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 816 files match defined criteria (97,336 lines of code, 4.6% vs. main code):
    • 391 *.json files (66,221 lines of code)
    • 383 *.xml files (23,617 lines of code)
    • 2 *.xsd files (3,875 lines of code)
    • 15 *.ini files (2,245 lines of code)
    • 25 *.md files (1,378 lines of code)
  • " *.json" is biggest, containing 68.03% of code.
  • " *.md" is smallest, containing 1.42% of code.


*.json66221 LOC (68%) 391 files
*.xml23617 LOC (24%) 383 files
*.xsd3875 LOC (3%) 2 files
*.ini2245 LOC (2%) 15 files
*.md1378 LOC (1%) 25 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
  • *.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)
  • *.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
  • *.man 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
  • *.inl 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
  • *.ps1xml 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
  • *.pl files are analyzed with PerlAnalyzer:
    • 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
    • Basic heuristic 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
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.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
  • *.py files are analyzed with PythonAnalyzer:
    • 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
    • Basic heuristic 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
  • *.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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.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
  • *.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
  • *.pm files are analyzed with PerlAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.spec 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
  • *.sfproj 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
  • *.csdef 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
  • *.awk 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
  • *.cscfg 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
  • *.cdf 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
  • *.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


2022-01-30 15:55