Linux / Scripts
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
cocci
txt
l
y
S
glade
ini
in
  • 18 extensions are included in analyses: h, html, cocci, c, sh, py, txt, pl, json, svg, gitignore, l, y, cc, S, glade, ini, in
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (10 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.

main129381 LOC (96%) 961 files
test455 LOC (<1%) 18 files
generated0 LOC (0%) 0 files
build and deployment2711 LOC (2%) 46 files
other1632 LOC (1%) 2 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cocci
y
l
glade
in
s
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 961 files match defined criteria (129,381 lines of code, 100.0% vs. main code):
    • 774 *.h files (72,321 lines of code)
    • 65 *.c files (29,850 lines of code)
    • 22 *.pl files (13,038 lines of code)
    • 68 *.cocci files (6,561 lines of code)
    • 22 *.py files (2,714 lines of code)
    • 1 *.cc files (1,582 lines of code)
    • 3 *.y files (1,570 lines of code)
    • 3 *.l files (1,022 lines of code)
    • 1 *.glade files (603 lines of code)
    • 1 *.in files (63 lines of code)
    • 1 *.s files (57 lines of code)
  • " *.h" is biggest, containing 55.9% of code.
  • " *.s" is smallest, containing 0.04% of code.


*.h72321 LOC (55%) 774 files
*.c29850 LOC (23%) 65 files
*.pl13038 LOC (10%) 22 files
*.cocci6561 LOC (5%) 68 files
*.py2714 LOC (2%) 22 files
*.cc1582 LOC (1%) 1 files
*.y1570 LOC (1%) 3 files
*.l1022 LOC (<1%) 3 files
*.glade603 LOC (<1%) 1 files
*.in63 LOC (<1%) 1 files
*.s57 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cocci
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
  • 18 files match defined criteria (455 lines of code, 0.4% vs. main code):
    • 4 *.cocci files (262 lines of code)
    • 13 *.py files (159 lines of code)
    • 1 *.sh files (34 lines of code)
  • " *.cocci" is biggest, containing 57.58% of code.
  • " *.sh" is smallest, containing 7.47% of code.


*.cocci262 LOC (57%) 4 files
*.py159 LOC (34%) 13 files
*.sh34 LOC (7%) 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 46 files match defined criteria (2,711 lines of code, 2.1% vs. main code). All matches are in *.sh files.


*.sh2711 LOC (100%) 46 files
Other Code
txt
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]txt".
  • 2 files match defined criteria (1,632 lines of code, 1.3% vs. main code):
    • 1 *.txt files (1,626 lines of code)
    • 1 *.ini files (6 lines of code)
  • " *.txt" is biggest, containing 99.63% of code.
  • " *.ini" is smallest, containing 0.37% of code.


*.txt1626 LOC (99%) 1 files
*.ini6 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.glade 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
  • *.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
  • *.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


2022-02-02 19:49