microsoft / DirectXShaderCompiler
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
ll
hlsl
txt
s
cfg
hlsli
cmake
in
cl
cmd
targets
resx
clang-format
inl
TXT
plist
natvis
man
el
clang-tidy
regex
S
arcconfig
csproj
gitmodules
xsd
gitattributes
ini
obj
  • 54 extensions are included in analyses: ll, cpp, hlsl, h, c, txt, py, s, rst, cfg, hlsli, xml, inc, cmake, cu, yaml, in, cs, sh, cc, cl, cmd, md, pl, targets, asm, json, bat, resx, yml, js, ps1, html, clang-format, inl, TXT, plist, hpp, css, natvis, man, gitignore, el, clang-tidy, regex, S, arcconfig, csproj, gitmodules, xsd, gitattributes, applescript, ini, obj
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (12 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (128 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (2 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (6 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) (435 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.

main1466640 LOC (72%) 3744 files
test486035 LOC (23%) 10441 files
generated33 LOC (<1%) 1 files
build and deployment1440 LOC (<1%) 19 files
other72923 LOC (3%) 509 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
cmd
inl
hlsl
in
natvis
man
el
txt
targets
hlsli
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 3744 files match defined criteria (1,466,640 lines of code, 100.0% vs. main code):
    • 1,839 *.cpp files (1,079,849 lines of code)
    • 1,614 *.h files (322,719 lines of code)
    • 69 *.py files (14,787 lines of code)
    • 22 *.c files (13,019 lines of code)
    • 23 *.cs files (10,864 lines of code)
    • 14 *.cc files (6,971 lines of code)
    • 30 *.inc files (4,690 lines of code)
    • 31 *.cmake files (4,133 lines of code)
    • 13 *.cmd files (2,101 lines of code)
    • 4 *.inl files (1,468 lines of code)
    • 27 *.hlsl files (1,458 lines of code)
    • 1 *.hpp files (854 lines of code)
    • 19 *.in files (801 lines of code)
    • 4 *.js files (657 lines of code)
    • 2 *.natvis files (596 lines of code)
    • 4 *.pl files (482 lines of code)
    • 2 *.man files (372 lines of code)
    • 2 *.el files (364 lines of code)
    • 5 *.yml files (230 lines of code)
    • 3 *.txt files (100 lines of code)
    • 7 *.targets files (59 lines of code)
    • 6 *.hlsli files (35 lines of code)
    • 1 *.applescript files (24 lines of code)
    • 2 *.cfg files (7 lines of code)
  • " *.cpp" is biggest, containing 73.63% of code.
  • " *.cfg" is smallest, containing 0% of code.


*.cpp1079849 LOC (73%) 1839 files
*.h322719 LOC (22%) 1614 files
*.py14787 LOC (1%) 69 files
*.c13019 LOC (<1%) 22 files
*.cs10864 LOC (<1%) 23 files
*.cc6971 LOC (<1%) 14 files
*.inc4690 LOC (<1%) 30 files
*.cmake4133 LOC (<1%) 31 files
*.cmd2101 LOC (<1%) 13 files
*.inl1468 LOC (<1%) 4 files
*.hlsl1458 LOC (<1%) 27 files
*.hpp854 LOC (<1%) 1 files
*.in801 LOC (<1%) 19 files
*.js657 LOC (<1%) 4 files
*.natvis596 LOC (<1%) 2 files
*.pl482 LOC (<1%) 4 files
*.man372 LOC (<1%) 2 files
*.el364 LOC (<1%) 2 files
*.yml230 LOC (<1%) 5 files
*.txt100 LOC (<1%) 3 files
*.targets59 LOC (<1%) 7 files
*.hlsli35 LOC (<1%) 6 files
*.applescript24 LOC (<1%) 1 files
*.cfg7 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
ll
hlsl
s
cfg
cl
in
hlsli
cmd
obj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*/test[-]data/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*TestUtils/.*".
  • 10441 files match defined criteria (486,035 lines of code, 33.1% vs. main code):
    • 3,743 *.ll files (197,424 lines of code)
    • 3,128 *.hlsl files (138,339 lines of code)
    • 1,878 *.cpp files (108,410 lines of code)
    • 1,080 *.c files (28,502 lines of code)
    • 281 *.h files (3,666 lines of code)
    • 34 *.py files (3,233 lines of code)
    • 110 *.s files (2,493 lines of code)
    • 31 *.cu files (1,042 lines of code)
    • 74 *.cfg files (867 lines of code)
    • 29 *.yaml files (849 lines of code)
    • 7 *.asm files (295 lines of code)
    • 5 *.inc files (257 lines of code)
    • 15 *.cl files (216 lines of code)
    • 4 *.pl files (157 lines of code)
    • 6 *.in files (122 lines of code)
    • 4 *.ps1 files (53 lines of code)
    • 1 *.cc files (51 lines of code)
    • 1 *.hlsli files (25 lines of code)
    • 5 *.sh files (10 lines of code)
    • 2 *.hpp files (8 lines of code)
    • 1 *.bat files (8 lines of code)
    • 1 *.cmd files (5 lines of code)
    • 1 *.obj files (3 lines of code)
  • " *.ll" is biggest, containing 40.62% of code.
  • " *.obj" is smallest, containing 0% of code.


*.ll197424 LOC (40%) 3743 files
*.hlsl138339 LOC (28%) 3128 files
*.cpp108410 LOC (22%) 1878 files
*.c28502 LOC (5%) 1080 files
*.h3666 LOC (<1%) 281 files
*.py3233 LOC (<1%) 34 files
*.s2493 LOC (<1%) 110 files
*.cu1042 LOC (<1%) 31 files
*.cfg867 LOC (<1%) 74 files
*.yaml849 LOC (<1%) 29 files
*.asm295 LOC (<1%) 7 files
*.inc257 LOC (<1%) 5 files
*.cl216 LOC (<1%) 15 files
*.pl157 LOC (<1%) 4 files
*.in122 LOC (<1%) 6 files
*.ps153 LOC (<1%) 4 files
*.cc51 LOC (<1%) 1 files
*.hlsli25 LOC (<1%) 1 files
*.sh10 LOC (<1%) 5 files
*.hpp8 LOC (<1%) 2 files
*.bat8 LOC (<1%) 1 files
*.cmd5 LOC (<1%) 1 files
*.obj3 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 1 file matches defined criteria (33 lines of code, 0.0% vs. main code). All matches are in *.cs files.


*.cs33 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
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 ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]csproj".
  • 19 files match defined criteria (1,440 lines of code, 0.1% vs. main code):
    • 16 *.sh files (1,051 lines of code)
    • 1 *.csproj files (224 lines of code)
    • 2 *.bat files (165 lines of code)
  • " *.sh" is biggest, containing 72.99% of code.
  • " *.bat" is smallest, containing 11.46% of code.


*.sh1051 LOC (72%) 16 files
*.csproj224 LOC (15%) 1 files
*.bat165 LOC (11%) 2 files
Other Code
hlsl
hlsli
xsd
plist
regex
cfg
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/COPYRIGHT[.][a-z0-9]+".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 509 files match defined criteria (72,923 lines of code, 5.0% vs. main code):
    • 394 *.hlsl files (56,507 lines of code)
    • 44 *.xml files (10,594 lines of code)
    • 42 *.hlsli files (4,376 lines of code)
    • 5 *.json files (482 lines of code)
    • 11 *.md files (380 lines of code)
    • 1 *.xsd files (310 lines of code)
    • 2 *.py files (85 lines of code)
    • 2 *.cpp files (66 lines of code)
    • 3 *.plist files (52 lines of code)
    • 1 *.regex files (47 lines of code)
    • 1 *.cfg files (16 lines of code)
    • 1 *.ini files (6 lines of code)
    • 2 *.h files (2 lines of code)
  • " *.hlsl" is biggest, containing 77.49% of code.
  • " *.h" is smallest, containing 0% of code.


*.hlsl56507 LOC (77%) 394 files
*.xml10594 LOC (14%) 44 files
*.hlsli4376 LOC (6%) 42 files
*.json482 LOC (<1%) 5 files
*.md380 LOC (<1%) 11 files
*.xsd310 LOC (<1%) 1 files
*.py85 LOC (<1%) 2 files
*.cpp66 LOC (<1%) 2 files
*.plist52 LOC (<1%) 3 files
*.regex47 LOC (<1%) 1 files
*.cfg16 LOC (<1%) 1 files
*.ini6 LOC (<1%) 1 files
*.h2 LOC (<1%) 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
  • *.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
  • *.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
  • *.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)
  • *.cc 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.hlsl 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
  • *.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
  • *.natvis 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
  • *.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
  • *.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
  • *.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
  • *.txt 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
  • *.hlsli 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
  • *.applescript 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
  • *.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


2022-01-30 14:19