android / ndk-samples
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
inl
properties
txt
mk
pro
vsh
fsh
org
TXT
glslv
clang-format
glslf
  • 28 extensions are included in analyses: hpp, xml, gradle, inl, cpp, h, properties, java, txt, bat, mk, md, c, yaml, pro, vsh, fsh, gitignore, sh, kt, yml, org, ts, TXT, json, glslv, clang-format, glslf
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (42 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (34 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (12 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 ".*[.]txt" (Text files) (43 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
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.

main90272 LOC (88%) 567 files
test94 LOC (<1%) 1 files
generated0 LOC (0%) 0 files
build and deployment6162 LOC (6%) 215 files
other5469 LOC (5%) 221 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
inl
vsh
org
fsh
txt
glslv
glslf
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 567 files match defined criteria (90,272 lines of code, 100.0% vs. main code):
    • 116 *.inl files (33,882 lines of code)
    • 78 *.h files (19,069 lines of code)
    • 103 *.cpp files (15,766 lines of code)
    • 175 *.hpp files (11,096 lines of code)
    • 44 *.java files (5,301 lines of code)
    • 21 *.c files (3,621 lines of code)
    • 10 *.vsh files (500 lines of code)
    • 2 *.org files (467 lines of code)
    • 10 *.fsh files (390 lines of code)
    • 5 *.kt files (161 lines of code)
    • 1 *.txt files (9 lines of code)
    • 1 *.glslv files (5 lines of code)
    • 1 *.glslf files (5 lines of code)
  • " *.inl" is biggest, containing 37.53% of code.
  • " *.glslf" is smallest, containing 0.01% of code.


*.inl33882 LOC (37%) 116 files
*.h19069 LOC (21%) 78 files
*.cpp15766 LOC (17%) 103 files
*.hpp11096 LOC (12%) 175 files
*.java5301 LOC (5%) 44 files
*.c3621 LOC (4%) 21 files
*.vsh500 LOC (<1%) 10 files
*.org467 LOC (<1%) 2 files
*.fsh390 LOC (<1%) 10 files
*.kt161 LOC (<1%) 5 files
*.txt9 LOC (<1%) 1 files
*.glslv5 LOC (<1%) 1 files
*.glslf5 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 1 file matches defined criteria (94 lines of code, 0.1% vs. main code). All matches are in *.java files.


*.java94 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]mk".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 215 files match defined criteria (6,162 lines of code, 6.8% vs. main code):
    • 42 *.bat files (2,989 lines of code)
    • 133 *.gradle files (2,458 lines of code)
    • 39 *.mk files (694 lines of code)
    • 1 *.sh files (21 lines of code)
  • " *.bat" is biggest, containing 48.51% of code.
  • " *.sh" is smallest, containing 0.34% of code.


*.bat2989 LOC (48%) 42 files
*.gradle2458 LOC (39%) 133 files
*.mk694 LOC (11%) 39 files
*.sh21 LOC (<1%) 1 files
Other Code
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 221 files match defined criteria (5,469 lines of code, 6.1% vs. main code):
    • 168 *.xml files (3,482 lines of code)
    • 36 *.md files (1,692 lines of code)
    • 17 *.properties files (295 lines of code)
  • " *.xml" is biggest, containing 63.67% of code.
  • " *.properties" is smallest, containing 5.39% of code.


*.xml3482 LOC (63%) 168 files
*.md1692 LOC (30%) 36 files
*.properties295 LOC (5%) 17 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 package names)
  • *.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
  • *.vsh 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
  • *.org 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
  • *.fsh 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
  • *.kt files are analyzed with KotlinAnalyzer:
    • 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 (based on imports and package statements)
  • *.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
  • *.glslv 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
  • *.glslf 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-03 05:23