flutter / engine
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
gn
gni
glsl
plist
txt
properties
clang-format
pro
storyboard
gitattributes
podspec
patch
clang-tidy
  • 34 extensions are included in analyses: h, cc, dart, java, mm, gn, py, yaml, gni, glsl, cpp, md, m, sh, gitignore, json, xml, plist, txt, gradle, properties, bat, svg, html, clang-format, yml, c, css, pro, storyboard, gitattributes, podspec, patch, clang-tidy
  • 12 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (40 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (2 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (434 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (2 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (7 files).
    • exclude files with path like ".*/[Jj]avadoc/.*" (Generated documentation) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (3 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 ".*/dist/.*" (Distributions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (5 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.

main268961 LOC (73%) 2189 files
test93152 LOC (25%) 502 files
generated0 LOC (0%) 0 files
build and deployment1323 LOC (<1%) 38 files
other3740 LOC (1%) 86 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
gn
gni
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2189 files match defined criteria (268,961 lines of code, 100.0% vs. main code):
    • 648 *.cc files (102,738 lines of code)
    • 282 *.dart files (67,429 lines of code)
    • 704 *.h files (30,758 lines of code)
    • 138 *.mm files (27,239 lines of code)
    • 144 *.java files (21,386 lines of code)
    • 82 *.gn files (7,956 lines of code)
    • 53 *.gni files (4,498 lines of code)
    • 52 *.py files (3,531 lines of code)
    • 27 *.m files (2,045 lines of code)
    • 54 *.yaml files (1,361 lines of code)
    • 1 *.html files (10 lines of code)
    • 1 *.css files (7 lines of code)
    • 3 *.c files (3 lines of code)
  • " *.cc" is biggest, containing 38.2% of code.
  • " *.c" is smallest, containing 0% of code.


*.cc102738 LOC (38%) 648 files
*.dart67429 LOC (25%) 282 files
*.h30758 LOC (11%) 704 files
*.mm27239 LOC (10%) 138 files
*.java21386 LOC (7%) 144 files
*.gn7956 LOC (2%) 82 files
*.gni4498 LOC (1%) 53 files
*.py3531 LOC (1%) 52 files
*.m2045 LOC (<1%) 27 files
*.yaml1361 LOC (<1%) 54 files
*.html10 LOC (<1%) 1 files
*.css7 LOC (<1%) 1 files
*.c3 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
glsl
gn
gni
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/src/androidTest/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 502 files match defined criteria (93,152 lines of code, 34.6% vs. main code):
    • 222 *.dart files (48,363 lines of code)
    • 81 *.cc files (22,918 lines of code)
    • 64 *.java files (13,973 lines of code)
    • 54 *.h files (3,826 lines of code)
    • 6 *.mm files (2,167 lines of code)
    • 54 *.glsl files (820 lines of code)
    • 3 *.py files (574 lines of code)
    • 8 *.gn files (240 lines of code)
    • 1 *.gni files (80 lines of code)
    • 1 *.gradle files (65 lines of code)
    • 4 *.sh files (64 lines of code)
    • 3 *.m files (34 lines of code)
    • 1 *.yaml files (28 lines of code)
  • " *.dart" is biggest, containing 51.92% of code.
  • " *.yaml" is smallest, containing 0.03% of code.


*.dart48363 LOC (51%) 222 files
*.cc22918 LOC (24%) 81 files
*.java13973 LOC (15%) 64 files
*.h3826 LOC (4%) 54 files
*.mm2167 LOC (2%) 6 files
*.glsl820 LOC (<1%) 54 files
*.py574 LOC (<1%) 3 files
*.gn240 LOC (<1%) 8 files
*.gni80 LOC (<1%) 1 files
*.gradle65 LOC (<1%) 1 files
*.sh64 LOC (<1%) 4 files
*.m34 LOC (<1%) 3 files
*.yaml28 LOC (<1%) 1 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 ".*[.]podspec".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]bat".
  • 38 files match defined criteria (1,323 lines of code, 0.5% vs. main code):
    • 24 *.sh files (890 lines of code)
    • 8 *.gradle files (270 lines of code)
    • 4 *.bat files (136 lines of code)
    • 2 *.podspec files (27 lines of code)
  • " *.sh" is biggest, containing 67.27% of code.
  • " *.podspec" is smallest, containing 2.04% of code.


*.sh890 LOC (67%) 24 files
*.gradle270 LOC (20%) 8 files
*.bat136 LOC (10%) 4 files
*.podspec27 LOC (2%) 2 files
Other Code
plist
storyboard
patch
gn
properties
gni
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 86 files match defined criteria (3,740 lines of code, 1.4% vs. main code):
    • 17 *.json files (1,605 lines of code)
    • 37 *.md files (970 lines of code)
    • 9 *.xml files (524 lines of code)
    • 11 *.plist files (306 lines of code)
    • 1 *.cc files (153 lines of code)
    • 1 *.dart files (60 lines of code)
    • 2 *.storyboard files (47 lines of code)
    • 1 *.patch files (31 lines of code)
    • 1 *.sh files (15 lines of code)
    • 1 *.gn files (11 lines of code)
    • 4 *.properties files (10 lines of code)
    • 1 *.gni files (8 lines of code)
  • " *.json" is biggest, containing 42.91% of code.
  • " *.gni" is smallest, containing 0.21% of code.


*.json1605 LOC (42%) 17 files
*.md970 LOC (25%) 37 files
*.xml524 LOC (14%) 9 files
*.plist306 LOC (8%) 11 files
*.cc153 LOC (4%) 1 files
*.dart60 LOC (1%) 1 files
*.storyboard47 LOC (1%) 2 files
*.patch31 LOC (<1%) 1 files
*.sh15 LOC (<1%) 1 files
*.gn11 LOC (<1%) 1 files
*.properties10 LOC (<1%) 4 files
*.gni8 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.mm 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)
  • *.gn 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
  • *.gni 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-02-03 01:21