facebook / facebook-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
storyboard
podspec
txt
gitattributes
editorconfig
  • 21 extensions are included in analyses: swift, h, m, json, plist, yml, storyboard, podspec, sh, md, xib, mm, py, hpp, txt, js, gitattributes, editorconfig, yaml, gitignore, rb
  • 1 criterion is used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (13 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.

main100308 LOC (92%) 1280 files
test247 LOC (<1%) 1 files
generated0 LOC (0%) 0 files
build and deployment754 LOC (<1%) 13 files
other6892 LOC (6%) 135 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1280 files match defined criteria (100,308 lines of code, 100.0% vs. main code):
    • 565 *.swift files (59,518 lines of code)
    • 205 *.m files (29,577 lines of code)
    • 492 *.h files (8,450 lines of code)
    • 8 *.yml files (1,070 lines of code)
    • 4 *.mm files (1,067 lines of code)
    • 2 *.hpp files (365 lines of code)
    • 3 *.py files (173 lines of code)
    • 1 *.rb files (88 lines of code)
  • " *.swift" is biggest, containing 59.34% of code.
  • " *.rb" is smallest, containing 0.09% of code.


*.swift59518 LOC (59%) 565 files
*.m29577 LOC (29%) 205 files
*.h8450 LOC (8%) 492 files
*.yml1070 LOC (1%) 8 files
*.mm1067 LOC (1%) 4 files
*.hpp365 LOC (<1%) 2 files
*.py173 LOC (<1%) 3 files
*.rb88 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 ".*/test_.*".
  • 1 file matches defined criteria (247 lines of code, 0.2% vs. main code). All matches are in *.sh files.


*.sh247 LOC (100%) 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 ".*/[.]gitattributes".
  • 13 files match defined criteria (754 lines of code, 0.8% vs. main code):
    • 5 *.sh files (427 lines of code)
    • 8 *.podspec files (327 lines of code)
  • " *.sh" is biggest, containing 56.63% of code.
  • " *.podspec" is smallest, containing 43.37% of code.


*.sh427 LOC (56%) 5 files
*.podspec327 LOC (43%) 8 files
Other Code
storyboard
plist
txt
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 ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]xib".
    • files with paths like ".*/[.]gitignore".
  • 135 files match defined criteria (6,892 lines of code, 6.9% vs. main code):
    • 12 *.m files (1,151 lines of code)
    • 6 *.md files (1,042 lines of code)
    • 5 *.xib files (1,020 lines of code)
    • 41 *.json files (961 lines of code)
    • 13 *.storyboard files (925 lines of code)
    • 24 *.plist files (864 lines of code)
    • 18 *.swift files (664 lines of code)
    • 1 *.sh files (88 lines of code)
    • 1 *.js files (83 lines of code)
    • 13 *.h files (80 lines of code)
    • 1 *.txt files (14 lines of code)
  • " *.m" is biggest, containing 16.7% of code.
  • " *.txt" is smallest, containing 0.2% of code.


*.m1151 LOC (16%) 12 files
*.md1042 LOC (15%) 6 files
*.xib1020 LOC (14%) 5 files
*.json961 LOC (13%) 41 files
*.storyboard925 LOC (13%) 13 files
*.plist864 LOC (12%) 24 files
*.swift664 LOC (9%) 18 files
*.sh88 LOC (1%) 1 files
*.js83 LOC (1%) 1 files
*.h80 LOC (1%) 13 files
*.txt14 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.yml 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
  • *.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
  • *.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
  • *.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
  • *.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


2022-04-14 22:40