apple / darwin-xnu
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
plist
lua
cocci
txt
y
awk
cmd
S
l
  • 24 extensions are included in analyses: h, c, html, cpp, s, py, plist, sh, d, m, md, lua, cocci, txt, y, pl, awk, xml, swift, cmd, S, json, gitignore, l
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (1 file).
    • 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) (4 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.

main1126517 LOC (90%) 2877 files
test87952 LOC (7%) 477 files
generated0 LOC (0%) 0 files
build and deployment1955 LOC (<1%) 17 files
other27475 LOC (2%) 313 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
s
y
lua
cocci
cmd
l
awk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2877 files match defined criteria (1,126,517 lines of code, 100.0% vs. main code):
    • 1,020 *.c files (789,510 lines of code)
    • 1,572 *.h files (194,048 lines of code)
    • 98 *.cpp files (87,811 lines of code)
    • 63 *.py files (24,193 lines of code)
    • 80 *.s files (23,645 lines of code)
    • 3 *.y files (2,132 lines of code)
    • 18 *.d files (1,819 lines of code)
    • 7 *.m files (853 lines of code)
    • 4 *.lua files (704 lines of code)
    • 5 *.cocci files (667 lines of code)
    • 3 *.pl files (556 lines of code)
    • 1 *.cmd files (378 lines of code)
    • 1 *.l files (149 lines of code)
    • 2 *.awk files (52 lines of code)
  • " *.c" is biggest, containing 70.08% of code.
  • " *.awk" is smallest, containing 0% of code.


*.c789510 LOC (70%) 1020 files
*.h194048 LOC (17%) 1572 files
*.cpp87811 LOC (7%) 98 files
*.py24193 LOC (2%) 63 files
*.s23645 LOC (2%) 80 files
*.y2132 LOC (<1%) 3 files
*.d1819 LOC (<1%) 18 files
*.m853 LOC (<1%) 7 files
*.lua704 LOC (<1%) 4 files
*.cocci667 LOC (<1%) 5 files
*.pl556 LOC (<1%) 3 files
*.cmd378 LOC (<1%) 1 files
*.l149 LOC (<1%) 1 files
*.awk52 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
s
lua
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 ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 477 files match defined criteria (87,952 lines of code, 7.8% vs. main code):
    • 302 *.c files (68,653 lines of code)
    • 111 *.cpp files (8,930 lines of code)
    • 10 *.m files (5,852 lines of code)
    • 40 *.h files (1,747 lines of code)
    • 1 *.swift files (1,092 lines of code)
    • 5 *.s files (878 lines of code)
    • 3 *.sh files (480 lines of code)
    • 3 *.lua files (246 lines of code)
    • 2 *.py files (74 lines of code)
  • " *.c" is biggest, containing 78.06% of code.
  • " *.py" is smallest, containing 0.08% of code.


*.c68653 LOC (78%) 302 files
*.cpp8930 LOC (10%) 111 files
*.m5852 LOC (6%) 10 files
*.h1747 LOC (1%) 40 files
*.swift1092 LOC (1%) 1 files
*.s878 LOC (<1%) 5 files
*.sh480 LOC (<1%) 3 files
*.lua246 LOC (<1%) 3 files
*.py74 LOC (<1%) 2 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 17 files match defined criteria (1,955 lines of code, 0.2% vs. main code). All matches are in *.sh files.


*.sh1955 LOC (100%) 17 files
Other Code
plist
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Mm]an/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 313 files match defined criteria (27,475 lines of code, 2.4% vs. main code):
    • 256 *.html files (19,408 lines of code)
    • 1 *.xml files (4,966 lines of code)
    • 8 *.md files (1,734 lines of code)
    • 46 *.plist files (1,239 lines of code)
    • 1 *.cpp files (107 lines of code)
    • 1 *.h files (21 lines of code)
  • " *.html" is biggest, containing 70.64% of code.
  • " *.h" is smallest, containing 0.08% of code.


*.html19408 LOC (70%) 256 files
*.xml4966 LOC (18%) 1 files
*.md1734 LOC (6%) 8 files
*.plist1239 LOC (4%) 46 files
*.cpp107 LOC (<1%) 1 files
*.h21 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
  • *.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
  • *.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
  • *.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
  • *.y 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
  • *.d files are analyzed with DAnalyzer:
    • 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
  • *.lua files are analyzed with LuaAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.l 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
  • *.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


2022-01-30 21:35