facebook / idb
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
mdx
dockerignore
storyboard
txt
proto
  • 20 extensions are included in analyses: h, m, py, plist, swift, mdx, md, js, sh, json, yml, mm, svg, gitignore, css, dockerignore, xib, storyboard, txt, proto
  • 2 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (12 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 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.

main55756 LOC (81%) 770 files
test8895 LOC (13%) 62 files
generated0 LOC (0%) 0 files
build and deployment419 LOC (<1%) 4 files
other3209 LOC (4%) 51 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 770 files match defined criteria (55,756 lines of code, 100.0% vs. main code):
    • 239 *.m files (35,008 lines of code)
    • 79 *.py files (8,238 lines of code)
    • 427 *.h files (8,124 lines of code)
    • 3 *.mm files (2,084 lines of code)
    • 17 *.swift files (1,340 lines of code)
    • 1 *.proto files (786 lines of code)
    • 3 *.js files (121 lines of code)
    • 1 *.css files (55 lines of code)
  • " *.m" is biggest, containing 62.79% of code.
  • " *.css" is smallest, containing 0.1% of code.


*.m35008 LOC (62%) 239 files
*.py8238 LOC (14%) 79 files
*.h8124 LOC (14%) 427 files
*.mm2084 LOC (3%) 3 files
*.swift1340 LOC (2%) 17 files
*.proto786 LOC (1%) 1 files
*.js121 LOC (<1%) 3 files
*.css55 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]ests/.*".
    • files with paths like ".*_tests[.].*".
  • 62 files match defined criteria (8,895 lines of code, 16.0% vs. main code):
    • 48 *.m files (6,741 lines of code)
    • 14 *.py files (2,154 lines of code)
  • " *.m" is biggest, containing 75.78% of code.
  • " *.py" is smallest, containing 24.22% of code.


*.m6741 LOC (75%) 48 files
*.py2154 LOC (24%) 14 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*/package[.]json".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/docker[-]compose[.]yml".
  • 4 files match defined criteria (419 lines of code, 0.8% vs. main code):
    • 3 *.sh files (402 lines of code)
    • 1 *.yml files (17 lines of code)
  • " *.sh" is biggest, containing 95.94% of code.
  • " *.yml" is smallest, containing 4.06% of code.


*.sh402 LOC (95%) 3 files
*.yml17 LOC (4%) 1 files
Other Code
plist
storyboard
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 ".*[.]plist".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]mdx".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*/[Dd]ocumentation/.*".
  • 51 files match defined criteria (3,209 lines of code, 5.8% vs. main code):
    • 3 *.json files (1,355 lines of code)
    • 39 *.plist files (835 lines of code)
    • 1 *.xib files (708 lines of code)
    • 7 *.md files (244 lines of code)
    • 1 *.storyboard files (67 lines of code)
  • " *.json" is biggest, containing 42.22% of code.
  • " *.storyboard" is smallest, containing 2.09% of code.


*.json1355 LOC (42%) 3 files
*.plist835 LOC (26%) 39 files
*.xib708 LOC (22%) 1 files
*.md244 LOC (7%) 7 files
*.storyboard67 LOC (2%) 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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-04-14 23:05