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

main50844 LOC (95%) 624 files
test0 LOC (0%) 0 files
generated0 LOC (0%) 0 files
build and deployment165 LOC (<1%) 6 files
other2126 LOC (4%) 65 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 ".*".
  • 624 files match defined criteria (50,844 lines of code, 100.0% vs. main code):
    • 257 *.mm files (37,808 lines of code)
    • 336 *.h files (11,428 lines of code)
    • 29 *.swift files (1,587 lines of code)
    • 2 *.m files (21 lines of code)
  • " *.mm" is biggest, containing 74.36% of code.
  • " *.m" is smallest, containing 0.04% of code.


*.mm37808 LOC (74%) 257 files
*.h11428 LOC (22%) 336 files
*.swift1587 LOC (3%) 29 files
*.m21 LOC (<1%) 2 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitignore".
  • 6 files match defined criteria (165 lines of code, 0.3% vs. main code):
    • 5 *.podspec files (93 lines of code)
    • 1 *.sh files (72 lines of code)
  • " *.podspec" is biggest, containing 56.36% of code.
  • " *.sh" is smallest, containing 43.64% of code.


*.podspec93 LOC (56%) 5 files
*.sh72 LOC (43%) 1 files
Other Code
plist
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]xib".
  • 65 files match defined criteria (2,126 lines of code, 4.2% vs. main code):
    • 12 *.mm files (758 lines of code)
    • 3 *.swift files (424 lines of code)
    • 15 *.plist files (366 lines of code)
    • 8 *.json files (238 lines of code)
    • 4 *.md files (140 lines of code)
    • 19 *.h files (120 lines of code)
    • 1 *.xib files (45 lines of code)
    • 3 *.m files (35 lines of code)
  • " *.mm" is biggest, containing 35.65% of code.
  • " *.m" is smallest, containing 1.65% of code.


*.mm758 LOC (35%) 12 files
*.swift424 LOC (19%) 3 files
*.plist366 LOC (17%) 15 files
*.json238 LOC (11%) 8 files
*.md140 LOC (6%) 4 files
*.h120 LOC (5%) 19 files
*.xib45 LOC (2%) 1 files
*.m35 LOC (1%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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


2022-04-14 23:03