flutter / codelabs
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
plist
txt
storyboard
properties
cmake
dockerignore
podspec
gitattributes
  • 31 extensions are included in analyses: dart, xml, plist, gitignore, h, json, swift, yaml, gradle, txt, cc, cpp, storyboard, md, properties, cmake, kt, html, xib, ts, m, js, svg, java, sh, dockerignore, podspec, css, gitattributes, yml, c
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (350 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (54 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (2 files).
    • exclude files with path like ".*[.]txt" (Text files) (152 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.

main59333 LOC (35%) 1499 files
test1410 LOC (<1%) 85 files
generated28186 LOC (16%) 6 files
build and deployment4802 LOC (2%) 166 files
other74671 LOC (44%) 1301 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1499 files match defined criteria (59,333 lines of code, 100.0% vs. main code):
    • 442 *.dart files (34,490 lines of code)
    • 121 *.cpp files (9,392 lines of code)
    • 44 *.html files (3,326 lines of code)
    • 280 *.h files (3,193 lines of code)
    • 121 *.cc files (2,675 lines of code)
    • 161 *.yaml files (2,065 lines of code)
    • 168 *.swift files (1,656 lines of code)
    • 30 *.ts files (1,211 lines of code)
    • 60 *.cmake files (740 lines of code)
    • 52 *.kt files (208 lines of code)
    • 15 *.m files (161 lines of code)
    • 3 *.java files (116 lines of code)
    • 1 *.c files (97 lines of code)
    • 1 *.css files (3 lines of code)
  • " *.dart" is biggest, containing 58.13% of code.
  • " *.css" is smallest, containing 0.01% of code.


*.dart34490 LOC (58%) 442 files
*.cpp9392 LOC (15%) 121 files
*.html3326 LOC (5%) 44 files
*.h3193 LOC (5%) 280 files
*.cc2675 LOC (4%) 121 files
*.yaml2065 LOC (3%) 161 files
*.swift1656 LOC (2%) 168 files
*.ts1211 LOC (2%) 30 files
*.cmake740 LOC (1%) 60 files
*.kt208 LOC (<1%) 52 files
*.m161 LOC (<1%) 15 files
*.java116 LOC (<1%) 3 files
*.c97 LOC (<1%) 1 files
*.css3 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 paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 85 files match defined criteria (1,410 lines of code, 2.4% vs. main code). All matches are in *.dart files.


*.dart1410 LOC (100%) 85 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 ".*/package[-]lock[.]json".
  • 6 files match defined criteria (28,186 lines of code, 47.5% vs. main code). All matches are in *.json files.


*.json28186 LOC (100%) 6 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
podspec
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 ".*[.]podspec".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/[.]gitattributes".
  • 166 files match defined criteria (4,802 lines of code, 8.1% vs. main code):
    • 161 *.gradle files (4,686 lines of code)
    • 3 *.sh files (82 lines of code)
    • 2 *.podspec files (34 lines of code)
  • " *.gradle" is biggest, containing 97.58% of code.
  • " *.podspec" is smallest, containing 0.71% of code.


*.gradle4686 LOC (97%) 161 files
*.sh82 LOC (1%) 3 files
*.podspec34 LOC (<1%) 2 files
Other Code
plist
storyboard
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 ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 1301 files match defined criteria (74,671 lines of code, 125.9% vs. main code):
    • 234 *.json files (42,098 lines of code)
    • 36 *.xib files (12,204 lines of code)
    • 355 *.plist files (7,665 lines of code)
    • 120 *.storyboard files (3,660 lines of code)
    • 378 *.xml files (3,375 lines of code)
    • 10 *.dart files (3,063 lines of code)
    • 112 *.md files (2,384 lines of code)
    • 54 *.properties files (192 lines of code)
    • 2 *.svg files (30 lines of code)
  • " *.json" is biggest, containing 56.38% of code.
  • " *.svg" is smallest, containing 0.04% of code.


*.json42098 LOC (56%) 234 files
*.xib12204 LOC (16%) 36 files
*.plist7665 LOC (10%) 355 files
*.storyboard3660 LOC (4%) 120 files
*.xml3375 LOC (4%) 378 files
*.dart3063 LOC (4%) 10 files
*.md2384 LOC (3%) 112 files
*.properties192 LOC (<1%) 54 files
*.svg30 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.dart 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.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
  • *.yaml 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
  • *.swift files are analyzed with SwiftAnalyzer:
    • 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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.css files are analyzed with CssAnalyzer:
    • 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-02-02 22:31