Linux / Tools
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
S
boot
xsl
po
cfg
l
y
awk
mk
feature
mak
lds
xs
  • 29 extensions are included in analyses: html, c, h, sh, json, txt, py, gitignore, S, boot, xsl, rst, po, cfg, pl, cpp, svg, l, y, awk, pm, mk, perl, rb, feature, mak, lds, xs, PL
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (145 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (37 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).
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.

main506853 LOC (57%) 2673 files
test102259 LOC (11%) 592 files
generated2 LOC (<1%) 2 files
build and deployment67146 LOC (7%) 432 files
other207580 LOC (23%) 568 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
s
po
y
awk
l
cfg
boot
xs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2673 files match defined criteria (506,853 lines of code, 100.0% vs. main code):
    • 1,649 *.c files (405,816 lines of code)
    • 820 *.h files (64,369 lines of code)
    • 68 *.py files (19,775 lines of code)
    • 11 *.pl files (4,461 lines of code)
    • 54 *.s files (4,324 lines of code)
    • 5 *.po files (3,995 lines of code)
    • 4 *.y files (1,818 lines of code)
    • 2 *.awk files (732 lines of code)
    • 4 *.l files (678 lines of code)
    • 14 *.cfg files (304 lines of code)
    • 6 *.cpp files (285 lines of code)
    • 3 *.pm files (190 lines of code)
    • 32 *.boot files (70 lines of code)
    • 1 *.xs files (36 lines of code)
  • " *.c" is biggest, containing 80.07% of code.
  • " *.xs" is smallest, containing 0.01% of code.


*.c405816 LOC (80%) 1649 files
*.h64369 LOC (12%) 820 files
*.py19775 LOC (3%) 68 files
*.pl4461 LOC (<1%) 11 files
*.s4324 LOC (<1%) 54 files
*.po3995 LOC (<1%) 5 files
*.y1818 LOC (<1%) 4 files
*.awk732 LOC (<1%) 2 files
*.l678 LOC (<1%) 4 files
*.cfg304 LOC (<1%) 14 files
*.cpp285 LOC (<1%) 6 files
*.pm190 LOC (<1%) 3 files
*.boot70 LOC (<1%) 32 files
*.xs36 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
s
feature
awk
lds
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.]feature".
  • 592 files match defined criteria (102,259 lines of code, 20.2% vs. main code):
    • 475 *.c files (88,897 lines of code)
    • 79 *.sh files (8,182 lines of code)
    • 6 *.py files (2,661 lines of code)
    • 22 *.h files (1,732 lines of code)
    • 6 *.s files (435 lines of code)
    • 1 *.feature files (232 lines of code)
    • 1 *.awk files (63 lines of code)
    • 1 *.lds files (35 lines of code)
    • 1 *.cpp files (22 lines of code)
  • " *.c" is biggest, containing 86.93% of code.
  • " *.cpp" is smallest, containing 0.02% of code.


*.c88897 LOC (86%) 475 files
*.sh8182 LOC (8%) 79 files
*.py2661 LOC (2%) 6 files
*.h1732 LOC (1%) 22 files
*.s435 LOC (<1%) 6 files
*.feature232 LOC (<1%) 1 files
*.awk63 LOC (<1%) 1 files
*.lds35 LOC (<1%) 1 files
*.cpp22 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 ".*/generated/.*".
  • 2 files match defined criteria (2 lines of code, 0.0% vs. main code). All matches are in *.h files.


*.h2 LOC (100%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mak
mk
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 ".*[.]sh".
    • files with paths like ".*[.]mk".
    • files with paths like ".*[.]mak".
  • 432 files match defined criteria (67,146 lines of code, 13.2% vs. main code):
    • 429 *.sh files (66,819 lines of code)
    • 1 *.mak files (164 lines of code)
    • 2 *.mk files (163 lines of code)
  • " *.sh" is biggest, containing 99.51% of code.
  • " *.mk" is smallest, containing 0.24% of code.


*.sh66819 LOC (99%) 429 files
*.mak164 LOC (<1%) 1 files
*.mk163 LOC (<1%) 2 files
Other Code
txt
xsl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Ee]xamples/.*".
  • 568 files match defined criteria (207,580 lines of code, 41.0% vs. main code):
    • 408 *.json files (184,411 lines of code)
    • 115 *.txt files (20,364 lines of code)
    • 15 *.rst files (1,799 lines of code)
    • 9 *.c files (548 lines of code)
    • 15 *.xsl files (183 lines of code)
    • 3 *.sh files (173 lines of code)
    • 2 *.perl files (77 lines of code)
    • 1 *.rb files (25 lines of code)
  • " *.json" is biggest, containing 88.84% of code.
  • " *.rb" is smallest, containing 0.01% of code.


*.json184411 LOC (88%) 408 files
*.txt20364 LOC (9%) 115 files
*.rst1799 LOC (<1%) 15 files
*.c548 LOC (<1%) 9 files
*.xsl183 LOC (<1%) 15 files
*.sh173 LOC (<1%) 3 files
*.perl77 LOC (<1%) 2 files
*.rb25 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.boot files are analyzed with ClojureLangAnalyzer:
    • 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
  • *.xs 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-02-02 22:46