facebook / facebook-sdk-for-unity
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
meta
asset
csproj
txt
properties
mdown
  • 23 extensions are included in analyses: cs, meta, xml, java, asset, csproj, unity, sh, md, h, txt, properties, ps1, gitignore, mdown, mm, prefab, bat, json, yml, cpp, m, gradle
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (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).
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.

main22091 LOC (62%) 300 files
test1833 LOC (5%) 67 files
generated3472 LOC (9%) 99 files
build and deployment1437 LOC (4%) 21 files
other6660 LOC (18%) 82 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
asset
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 300 files match defined criteria (22,091 lines of code, 100.0% vs. main code):
    • 206 *.cs files (16,400 lines of code)
    • 21 *.java files (1,971 lines of code)
    • 16 *.asset files (1,613 lines of code)
    • 2 *.mm files (906 lines of code)
    • 47 *.xml files (600 lines of code)
    • 3 *.ps1 files (423 lines of code)
    • 1 *.m files (111 lines of code)
    • 4 *.h files (67 lines of code)
  • " *.cs" is biggest, containing 74.24% of code.
  • " *.h" is smallest, containing 0.3% of code.


*.cs16400 LOC (74%) 206 files
*.java1971 LOC (8%) 21 files
*.asset1613 LOC (7%) 16 files
*.mm906 LOC (4%) 2 files
*.xml600 LOC (2%) 47 files
*.ps1423 LOC (1%) 3 files
*.m111 LOC (<1%) 1 files
*.h67 LOC (<1%) 4 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 ".*[.][Tt]ests/.*".
  • 67 files match defined criteria (1,833 lines of code, 8.3% vs. main code):
    • 60 *.cs files (1,775 lines of code)
    • 6 *.xml files (48 lines of code)
    • 1 *.sh files (10 lines of code)
  • " *.cs" is biggest, containing 96.84% of code.
  • " *.sh" is smallest, containing 0.55% of code.


*.cs1775 LOC (96%) 60 files
*.xml48 LOC (2%) 6 files
*.sh10 LOC (<1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
meta
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]meta" AND any line of content like ".*fileFormatVersion[:] .*".
  • 99 files match defined criteria (3,472 lines of code, 15.7% vs. main code). All matches are in *.meta files.


*.meta3472 LOC (100%) 99 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]bat".
  • 21 files match defined criteria (1,437 lines of code, 6.5% vs. main code):
    • 9 *.csproj files (672 lines of code)
    • 9 *.sh files (635 lines of code)
    • 1 *.bat files (66 lines of code)
    • 1 *.gradle files (59 lines of code)
    • 1 *.xml files (5 lines of code)
  • " *.csproj" is biggest, containing 46.76% of code.
  • " *.xml" is smallest, containing 0.35% of code.


*.csproj672 LOC (46%) 9 files
*.sh635 LOC (44%) 9 files
*.bat66 LOC (4%) 1 files
*.gradle59 LOC (4%) 1 files
*.xml5 LOC (<1%) 1 files
Other Code
meta
mdown
properties
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]mdown".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 82 files match defined criteria (6,660 lines of code, 30.1% vs. main code):
    • 3 *.md files (2,055 lines of code)
    • 9 *.unity files (1,908 lines of code)
    • 22 *.cs files (1,775 lines of code)
    • 38 *.meta files (422 lines of code)
    • 1 *.prefab files (266 lines of code)
    • 2 *.mdown files (76 lines of code)
    • 1 *.json files (72 lines of code)
    • 3 *.properties files (46 lines of code)
    • 3 *.txt files (40 lines of code)
  • " *.md" is biggest, containing 30.86% of code.
  • " *.txt" is smallest, containing 0.6% of code.


*.md2055 LOC (30%) 3 files
*.unity1908 LOC (28%) 9 files
*.cs1775 LOC (26%) 22 files
*.meta422 LOC (6%) 38 files
*.prefab266 LOC (3%) 1 files
*.mdown76 LOC (1%) 2 files
*.json72 LOC (1%) 1 files
*.properties46 LOC (<1%) 3 files
*.txt40 LOC (<1%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 namespace heuristics)
  • *.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)
  • *.asset 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
  • *.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
  • *.xml files are analyzed with XmlAnalyzer:
    • 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
  • *.ps1 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
  • *.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


2022-04-14 23:05