alibaba / MNN
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
s
txt
cl
proto
metal
glsl
lua
in
plist
properties
storyboard
patch
mk
pro
podspec
vert
editorconfig
clang-format
csproj
frag
gitattributes
inl
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.

main531272 LOC (80%) 2,794 files
test28996 LOC (4%) 191 files
generated74864 LOC (11%) 148 files
build and deployment2839 LOC (<1%) 89 files
other24394 LOC (3%) 273 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cl
proto
metal
inl
glsl
frag
vert
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 2794 files match defined criteria (531,272 LOC, 100.0% vs. main code):
    • 1,278 *.cpp files (335,645 LOC)
    • 732 *.hpp files (44,049 LOC)
    • 105 *.h files (29,797 LOC)
    • 137 *.py files (27,404 LOC)
    • 72 *.cl files (20,859 LOC)
    • 74 *.cu files (19,543 LOC)
    • 22 *.proto files (10,238 LOC)
    • 38 *.mm files (8,490 LOC)
    • 95 *.kt files (8,041 LOC)
    • 5 *.c files (6,208 LOC)
    • 34 *.metal files (3,520 LOC)
    • 52 *.swift files (3,153 LOC)
    • 74 *.xml files (2,917 LOC)
    • 3 *.cc files (2,792 LOC)
    • 1 *.inl files (2,639 LOC)
    • 11 *.cuh files (1,418 LOC)
    • 1 *.css files (1,400 LOC)
    • 7 *.cmake files (1,109 LOC)
    • 34 *.glsl files (1,018 LOC)
    • 6 *.ps1 files (629 LOC)
    • 3 *.js files (197 LOC)
    • 4 *.java files (118 LOC)
    • 1 *.toml files (37 LOC)
    • 1 *.frag files (15 LOC)
    • 1 *.vert files (15 LOC)
    • 1 *.yaml files (10 LOC)
    • 1 *.m files (7 LOC)
    • 1 *.html files (4 LOC)
  • " *.cpp" is biggest, containing 63.18% of LOC.
  • " *.html" is smallest, containing 0% of LOC.


*.cpp335645 LOC (63%) 1,278 files
*.hpp44049 LOC (8%) 732 files
*.h29797 LOC (5%) 105 files
*.py27404 LOC (5%) 137 files
*.cl20859 LOC (3%) 72 files
*.cu19543 LOC (3%) 74 files
*.proto10238 LOC (1%) 22 files
*.mm8490 LOC (1%) 38 files
*.kt8041 LOC (1%) 95 files
*.c6208 LOC (1%) 5 files
*.metal3520 LOC (<1%) 34 files
*.swift3153 LOC (<1%) 52 files
*.xml2917 LOC (<1%) 74 files
*.cc2792 LOC (<1%) 3 files
*.inl2639 LOC (<1%) 1 file
*.cuh1418 LOC (<1%) 11 files
*.css1400 LOC (<1%) 1 file
*.cmake1109 LOC (<1%) 7 files
*.glsl1018 LOC (<1%) 34 files
*.ps1629 LOC (<1%) 6 files
*.js197 LOC (<1%) 3 files
*.java118 LOC (<1%) 4 files
*.toml37 LOC (<1%) 1 file
*.frag15 LOC (<1%) 1 file
*.vert15 LOC (<1%) 1 file
*.yaml10 LOC (<1%) 1 file
*.m7 LOC (<1%) 1 file
*.html4 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
s
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/src/androidTest/.*".
  • 191 files match defined criteria (28,996 LOC, 5.5% vs. main code):
    • 169 *.cpp files (25,889 LOC)
    • 8 *.py files (1,687 LOC)
    • 4 *.sh files (688 LOC)
    • 3 *.hpp files (231 LOC)
    • 1 *.ps1 files (220 LOC)
    • 2 *.h files (148 LOC)
    • 1 *.s files (101 LOC)
    • 1 *.xml files (16 LOC)
    • 1 *.mm files (9 LOC)
    • 1 *.bat files (7 LOC)
  • " *.cpp" is biggest, containing 89.28% of LOC.
  • " *.bat" is smallest, containing 0.02% of LOC.


*.cpp25889 LOC (89%) 169 files
*.py1687 LOC (5%) 8 files
*.sh688 LOC (2%) 4 files
*.hpp231 LOC (<1%) 3 files
*.ps1220 LOC (<1%) 1 file
*.h148 LOC (<1%) 2 files
*.s101 LOC (<1%) 1 file
*.xml16 LOC (<1%) 1 file
*.mm9 LOC (<1%) 1 file
*.bat7 LOC (<1%) 1 file
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with any line of content like "//[ ]*Generated by .*".
    • files with paths like ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
    • files with paths like ".*_generated[.][a-z]+".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
    • files with paths like ".*[.](cpp|hpp|h|cc)" AND any line of content like ".*[/][/] Generated by the gRPC.*".
    • files with paths like ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
    • files with any line of content like "// This file was generated .*".
    • files with paths like ".*/generated/.*".
  • 148 files match defined criteria (74,864 LOC, 14.1% vs. main code):
    • 29 *.h files (43,456 LOC)
    • 12 *.cc files (17,732 LOC)
    • 107 *.html files (13,676 LOC)
  • " *.h" is biggest, containing 58.05% of LOC.
  • " *.html" is smallest, containing 18.27% of LOC.


*.h43456 LOC (58%) 29 files
*.cc17732 LOC (23%) 12 files
*.html13676 LOC (18%) 107 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 ".*/pom[.]xml".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]mk".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]podspec".
  • 89 files match defined criteria (2,839 LOC, 0.5% vs. main code):
    • 74 *.sh files (2,313 LOC)
    • 6 *.gradle files (205 LOC)
    • 2 *.podspec files (137 LOC)
    • 5 *.bat files (95 LOC)
    • 2 *.xml files (89 LOC)
  • " *.sh" is biggest, containing 81.47% of LOC.
  • " *.xml" is smallest, containing 3.13% of LOC.


*.sh2313 LOC (81%) 74 files
*.gradle205 LOC (7%) 6 files
*.podspec137 LOC (4%) 2 files
*.bat95 LOC (3%) 5 files
*.xml89 LOC (3%) 2 files
Other Code
txt
patch
storyboard
plist
properties
metal
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/INSTALL[.][a-z0-9]+".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]patch".
  • 273 files match defined criteria (24,394 LOC, 4.6% vs. main code):
    • 63 *.txt files (9,001 LOC)
    • 28 *.cpp files (4,789 LOC)
    • 47 *.json files (2,512 LOC)
    • 43 *.md files (2,499 LOC)
    • 22 *.java files (2,022 LOC)
    • 7 *.h files (833 LOC)
    • 17 *.py files (610 LOC)
    • 15 *.xml files (530 LOC)
    • 1 *.mm files (509 LOC)
    • 9 *.hpp files (385 LOC)
    • 2 *.patch files (256 LOC)
    • 3 *.storyboard files (204 LOC)
    • 6 *.plist files (96 LOC)
    • 3 *.gradle files (69 LOC)
    • 2 *.properties files (35 LOC)
    • 1 *.metal files (29 LOC)
    • 2 *.m files (13 LOC)
    • 2 *.svg files (2 LOC)
  • " *.txt" is biggest, containing 36.9% of LOC.
  • " *.svg" is smallest, containing 0.01% of LOC.


*.txt9001 LOC (36%) 63 files
*.cpp4789 LOC (19%) 28 files
*.json2512 LOC (10%) 47 files
*.md2499 LOC (10%) 43 files
*.java2022 LOC (8%) 22 files
*.h833 LOC (3%) 7 files
*.py610 LOC (2%) 17 files
*.xml530 LOC (2%) 15 files
*.mm509 LOC (2%) 1 file
*.hpp385 LOC (1%) 9 files
*.patch256 LOC (1%) 2 files
*.storyboard204 LOC (<1%) 3 files
*.plist96 LOC (<1%) 6 files
*.gradle69 LOC (<1%) 3 files
*.properties35 LOC (<1%) 2 files
*.metal29 LOC (<1%) 1 file
*.m13 LOC (<1%) 2 files
*.svg2 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.cpp 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
  • *.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
  • *.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
  • *.cl 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
  • *.cu 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
  • *.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
  • *.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
  • *.kt files are analyzed with KotlinAnalyzer:
    • 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 (based on imports and package statements)
  • *.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
  • *.metal 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
  • *.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
  • *.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
  • *.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
  • *.inl 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
  • *.cuh 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
  • *.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
  • *.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
  • *.glsl 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
  • *.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
  • *.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
  • *.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)
  • *.toml 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
  • *.frag 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
  • *.vert 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
  • *.yaml 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
  • *.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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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


2025-05-14 18:53