microsoft / mu_basecore
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
nasm
S
txt
ini
mak
g
cmd
s
lds
ps
pyw
g4
gitmodules
nsh
xsd
  • 32 extensions are included in analyses: c, h, nasm, py, S, asm, yaml, bat, md, txt, inc, json, yml, cpp, ini, mak, g, gitignore, html, cmd, rst, r, s, lds, ps, pyw, xml, g4, gitmodules, nsh, xsd, pl
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (57 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) (24 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.

main967840 LOC (97%) 4164 files
test18833 LOC (1%) 51 files
generated427 LOC (<1%) 1 files
build and deployment1969 LOC (<1%) 48 files
other6110 LOC (<1%) 52 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
nasm
s
g
pyw
g4
lds
nsh
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 4164 files match defined criteria (967,840 lines of code, 100.0% vs. main code):
    • 1,720 *.c files (589,113 lines of code)
    • 1,514 *.h files (161,249 lines of code)
    • 324 *.py files (112,886 lines of code)
    • 380 *.nasm files (53,802 lines of code)
    • 94 *.s files (25,789 lines of code)
    • 4 *.g files (8,837 lines of code)
    • 11 *.cpp files (7,787 lines of code)
    • 59 *.asm files (3,557 lines of code)
    • 2 *.r files (975 lines of code)
    • 1 *.pyw files (889 lines of code)
    • 29 *.yaml files (835 lines of code)
    • 1 *.g4 files (518 lines of code)
    • 18 *.inc files (515 lines of code)
    • 2 *.html files (510 lines of code)
    • 1 *.pl files (334 lines of code)
    • 2 *.lds files (128 lines of code)
    • 1 *.yml files (64 lines of code)
    • 1 *.nsh files (52 lines of code)
  • " *.c" is biggest, containing 60.87% of code.
  • " *.nsh" is smallest, containing 0.01% of code.


*.c589113 LOC (60%) 1720 files
*.h161249 LOC (16%) 1514 files
*.py112886 LOC (11%) 324 files
*.nasm53802 LOC (5%) 380 files
*.s25789 LOC (2%) 94 files
*.g8837 LOC (<1%) 4 files
*.cpp7787 LOC (<1%) 11 files
*.asm3557 LOC (<1%) 59 files
*.r975 LOC (<1%) 2 files
*.pyw889 LOC (<1%) 1 files
*.yaml835 LOC (<1%) 29 files
*.g4518 LOC (<1%) 1 files
*.inc515 LOC (<1%) 18 files
*.html510 LOC (<1%) 2 files
*.pl334 LOC (<1%) 1 files
*.lds128 LOC (<1%) 2 files
*.yml64 LOC (<1%) 1 files
*.nsh52 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/UnitTests?/.*".
    • 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/.*".
  • 51 files match defined criteria (18,833 lines of code, 1.9% vs. main code):
    • 28 *.c files (14,673 lines of code)
    • 15 *.py files (2,881 lines of code)
    • 6 *.h files (1,200 lines of code)
    • 2 *.cmd files (79 lines of code)
  • " *.c" is biggest, containing 77.91% of code.
  • " *.cmd" is smallest, containing 0.42% of code.


*.c14673 LOC (77%) 28 files
*.py2881 LOC (15%) 15 files
*.h1200 LOC (6%) 6 files
*.cmd79 LOC (<1%) 2 files
Generated Code
Automatically generated files, not manually changed after generation.
ps
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.](ps|eps|pfa)".
  • 1 file matches defined criteria (427 lines of code, 0.0% vs. main code). All matches are in *.ps files.


*.ps427 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mak
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 ".*/[.]gitmodules".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]mak".
  • 48 files match defined criteria (1,969 lines of code, 0.2% vs. main code):
    • 41 *.bat files (1,211 lines of code)
    • 7 *.mak files (758 lines of code)
  • " *.bat" is biggest, containing 61.5% of code.
  • " *.mak" is smallest, containing 38.5% of code.


*.bat1211 LOC (61%) 41 files
*.mak758 LOC (38%) 7 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 ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 52 files match defined criteria (6,110 lines of code, 0.6% vs. main code):
    • 1 *.xsd files (3,053 lines of code)
    • 24 *.md files (2,068 lines of code)
    • 9 *.ini files (427 lines of code)
    • 1 *.xml files (319 lines of code)
    • 2 *.rst files (147 lines of code)
    • 15 *.json files (96 lines of code)
  • " *.xsd" is biggest, containing 49.97% of code.
  • " *.json" is smallest, containing 1.57% of code.


*.xsd3053 LOC (49%) 1 files
*.md2068 LOC (33%) 24 files
*.ini427 LOC (6%) 9 files
*.xml319 LOC (5%) 1 files
*.rst147 LOC (2%) 2 files
*.json96 LOC (1%) 15 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
  • *.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
  • *.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
  • *.nasm 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
  • *.g 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
  • *.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
  • *.asm 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
  • *.r files are analyzed with RAnalyzer:
    • 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
  • *.pyw 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
  • *.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
  • *.g4 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
  • *.inc files are analyzed with PhpAnalyzer:
    • 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
  • *.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
  • *.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
  • *.lds 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
  • *.nsh files are analyzed with AdabasNaturalAnalyzer:
    • 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 22:07