firebase / firebase-ios-sdk
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
podspec
storyboard
proto
cmake
clang-format
sed
in
clang-tidy
ini
  • 28 extensions are included in analyses: h, m, cc, swift, json, mm, md, plist, sh, txt, yml, podspec, storyboard, py, proto, cmake, c, rb, xib, clang-format, sed, svg, in, clang-tidy, js, ini, gitignore, hpp
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (30 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (51 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (14 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (1 file).
    • 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) (41 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.

main221737 LOC (32%) 2114 files
test131189 LOC (19%) 949 files
generated0 LOC (0%) 0 files
build and deployment4405 LOC (<1%) 85 files
other320446 LOC (47%) 350 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
cmake
in
sed
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2114 files match defined criteria (221,737 lines of code, 100.0% vs. main code):
    • 572 *.m files (68,663 lines of code)
    • 192 *.cc files (66,545 lines of code)
    • 1,065 *.h files (53,596 lines of code)
    • 153 *.swift files (12,646 lines of code)
    • 28 *.py files (6,362 lines of code)
    • 41 *.mm files (4,584 lines of code)
    • 19 *.c files (4,116 lines of code)
    • 24 *.proto files (3,480 lines of code)
    • 11 *.cmake files (856 lines of code)
    • 5 *.rb files (777 lines of code)
    • 1 *.js files (82 lines of code)
    • 1 *.in files (21 lines of code)
    • 2 *.sed files (9 lines of code)
  • " *.m" is biggest, containing 30.97% of code.
  • " *.sed" is smallest, containing 0% of code.


*.m68663 LOC (30%) 572 files
*.cc66545 LOC (30%) 192 files
*.h53596 LOC (24%) 1065 files
*.swift12646 LOC (5%) 153 files
*.py6362 LOC (2%) 28 files
*.mm4584 LOC (2%) 41 files
*.c4116 LOC (1%) 19 files
*.proto3480 LOC (1%) 24 files
*.cmake856 LOC (<1%) 11 files
*.rb777 LOC (<1%) 5 files
*.js82 LOC (<1%) 1 files
*.in21 LOC (<1%) 1 files
*.sed9 LOC (<1%) 2 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 ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/IntegrationTests?/.*".
    • files with paths like ".*/UnitTests?/.*".
    • files with paths like ".*/Mocks/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 949 files match defined criteria (131,189 lines of code, 59.2% vs. main code):
    • 453 *.m files (79,036 lines of code)
    • 125 *.cc files (22,960 lines of code)
    • 103 *.swift files (15,898 lines of code)
    • 51 *.mm files (9,527 lines of code)
    • 211 *.h files (3,630 lines of code)
    • 6 *.sh files (138 lines of code)
  • " *.m" is biggest, containing 60.25% of code.
  • " *.sh" is smallest, containing 0.11% of code.


*.m79036 LOC (60%) 453 files
*.cc22960 LOC (17%) 125 files
*.swift15898 LOC (12%) 103 files
*.mm9527 LOC (7%) 51 files
*.h3630 LOC (2%) 211 files
*.sh138 LOC (<1%) 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 ".*[.]podspec".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 85 files match defined criteria (4,405 lines of code, 2.0% vs. main code):
    • 36 *.podspec files (2,224 lines of code)
    • 49 *.sh files (2,181 lines of code)
  • " *.podspec" is biggest, containing 50.49% of code.
  • " *.sh" is smallest, containing 49.51% of code.


*.podspec2224 LOC (50%) 36 files
*.sh2181 LOC (49%) 49 files
Other Code
storyboard
plist
ini
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 ".*[.]json".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]xib".
    • files with paths like ".*/[.]gitignore".
  • 350 files match defined criteria (320,446 lines of code, 144.5% vs. main code):
    • 166 *.json files (308,579 lines of code)
    • 80 *.md files (5,325 lines of code)
    • 32 *.storyboard files (2,848 lines of code)
    • 66 *.plist files (2,513 lines of code)
    • 5 *.xib files (1,162 lines of code)
    • 1 *.ini files (19 lines of code)
  • " *.json" is biggest, containing 96.3% of code.
  • " *.ini" is smallest, containing 0.01% of code.


*.json308579 LOC (96%) 166 files
*.md5325 LOC (1%) 80 files
*.storyboard2848 LOC (<1%) 32 files
*.plist2513 LOC (<1%) 66 files
*.xib1162 LOC (<1%) 5 files
*.ini19 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.proto 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
  • *.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
  • *.rb files are analyzed with RubyAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.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
  • *.sed 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


2022-02-03 05:36