microsoft / git
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
po
tcl
patch
diff
gitattributes
cocci
in
t
xsl
mbox
el
S
sed
editorconfig
tcsh
plist
m4
clang-format
gitmodules
  • 38 extensions are included in analyses: sh, txt, c, h, po, tcl, gitignore, perl, pm, patch, diff, pl, md, gitattributes, cocci, yml, in, t, js, xsl, py, go, mbox, bat, css, el, bash, rb, zsh, S, sed, json, editorconfig, tcsh, plist, m4, clang-format, gitmodules
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (69 files).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (79 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (5 files).
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (0 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (717 files).
    • exclude files with path like ".*/static/js/.*" (JS library) (6 files).
    • exclude files with path like ".*/(vuejs|js/lib)/.*" (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.

main719941 LOC (75%) 1036 files
test2974 LOC (<1%) 15 files
generated0 LOC (0%) 0 files
build and deployment222199 LOC (23%) 1154 files
other4242 LOC (<1%) 66 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
po
tcl
mbox
cocci
sed
s
tcsh
t
in
el
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1036 files match defined criteria (719,941 lines of code, 100.0% vs. main code):
    • 54 *.po files (397,208 lines of code)
    • 549 *.c files (251,684 lines of code)
    • 277 *.h files (20,821 lines of code)
    • 24 *.perl files (20,372 lines of code)
    • 40 *.tcl files (11,206 lines of code)
    • 25 *.pm files (7,513 lines of code)
    • 3 *.py files (3,300 lines of code)
    • 2 *.bash files (2,963 lines of code)
    • 18 *.pl files (1,600 lines of code)
    • 3 *.mbox files (709 lines of code)
    • 14 *.cocci files (544 lines of code)
    • 1 *.css files (540 lines of code)
    • 4 *.go files (421 lines of code)
    • 1 *.sed files (267 lines of code)
    • 1 *.zsh files (232 lines of code)
    • 1 *.s files (198 lines of code)
    • 1 *.tcsh files (109 lines of code)
    • 7 *.t files (109 lines of code)
    • 8 *.in files (103 lines of code)
    • 1 *.js files (30 lines of code)
    • 2 *.el files (12 lines of code)
  • " *.po" is biggest, containing 55.17% of code.
  • " *.el" is smallest, containing 0% of code.


*.po397208 LOC (55%) 54 files
*.c251684 LOC (34%) 549 files
*.h20821 LOC (2%) 277 files
*.perl20372 LOC (2%) 24 files
*.tcl11206 LOC (1%) 40 files
*.pm7513 LOC (1%) 25 files
*.py3300 LOC (<1%) 3 files
*.bash2963 LOC (<1%) 2 files
*.pl1600 LOC (<1%) 18 files
*.mbox709 LOC (<1%) 3 files
*.cocci544 LOC (<1%) 14 files
*.css540 LOC (<1%) 1 files
*.go421 LOC (<1%) 4 files
*.sed267 LOC (<1%) 1 files
*.zsh232 LOC (<1%) 1 files
*.s198 LOC (<1%) 1 files
*.tcsh109 LOC (<1%) 1 files
*.t109 LOC (<1%) 7 files
*.in103 LOC (<1%) 8 files
*.js30 LOC (<1%) 1 files
*.el12 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 15 files match defined criteria (2,974 lines of code, 0.4% vs. main code):
    • 10 *.c files (2,465 lines of code)
    • 4 *.sh files (474 lines of code)
    • 1 *.h files (35 lines of code)
  • " *.c" is biggest, containing 82.89% of code.
  • " *.h" is smallest, containing 1.18% of code.


*.c2465 LOC (82%) 10 files
*.sh474 LOC (15%) 4 files
*.h35 LOC (1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*/[.]gitmodules".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
  • 1154 files match defined criteria (222,199 lines of code, 30.9% vs. main code):
    • 1,151 *.sh files (221,914 lines of code)
    • 3 *.bat files (285 lines of code)
  • " *.sh" is biggest, containing 99.87% of code.
  • " *.bat" is smallest, containing 0.13% of code.


*.sh221914 LOC (99%) 1151 files
*.bat285 LOC (<1%) 3 files
Other Code
patch
diff
xsl
plist
in
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 ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]diff".
  • 66 files match defined criteria (4,242 lines of code, 0.6% vs. main code):
    • 18 *.patch files (2,146 lines of code)
    • 9 *.md files (1,145 lines of code)
    • 7 *.perl files (322 lines of code)
    • 1 *.css files (243 lines of code)
    • 4 *.sh files (138 lines of code)
    • 18 *.diff files (100 lines of code)
    • 6 *.xsl files (67 lines of code)
    • 1 *.rb files (43 lines of code)
    • 1 *.plist files (30 lines of code)
    • 1 *.in files (8 lines of code)
  • " *.patch" is biggest, containing 50.59% of code.
  • " *.in" is smallest, containing 0.19% of code.


*.patch2146 LOC (50%) 18 files
*.md1145 LOC (26%) 9 files
*.perl322 LOC (7%) 7 files
*.css243 LOC (5%) 1 files
*.sh138 LOC (3%) 4 files
*.diff100 LOC (2%) 18 files
*.xsl67 LOC (1%) 6 files
*.rb43 LOC (1%) 1 files
*.plist30 LOC (<1%) 1 files
*.in8 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.po 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
  • *.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
  • *.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
  • *.perl 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
  • *.tcl 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
  • *.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
  • *.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
  • *.bash files are analyzed with ShellAnalyzer:
    • 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
  • *.mbox 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
  • *.cocci 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
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
  • *.sed 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
  • *.zsh files are analyzed with ShellAnalyzer:
    • 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
  • *.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
  • *.tcsh 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
  • *.t 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
  • *.in files are analyzed with RustAnalyzer:
    • 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
  • *.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
  • *.el 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:43