opensearch-project / opensearch-php
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,099 units with 10,252 lines of code in units (78.5% of code).
    • 1 very long units (108 lines of code)
    • 6 long units (404 lines of code)
    • 50 medium size units (1,385 lines of code)
    • 246 small units (3,206 lines of code)
    • 796 very small units (5,149 lines of code)
1% | 3% | 13% | 31% | 50%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
php1% | 3% | 13% | 31% | 50%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
util7% | 18% | 32% | 17% | 24%
src/OpenSearch0% | 8% | 7% | 47% | 35%
src/OpenSearch/Connections0% | 13% | 55% | 11% | 19%
src/OpenSearch/Endpoints0% | 0% | 8% | 30% | 60%
src/OpenSearch/ConnectionPool0% | 0% | 31% | 39% | 28%
src/OpenSearch/Namespaces0% | 0% | 1% | 37% | 60%
src/OpenSearch/Serializers0% | 0% | 0% | 90% | 9%
src/OpenSearch/Helper0% | 0% | 0% | 43% | 56%
src/OpenSearch/Common0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public function build()
in util/YamlTests.php
108 14 0
public function build()
in src/OpenSearch/ClientBuilder.php
85 23 0
private function extractUrl()
in util/Endpoint.php
78 15 1
private function wrapHandler()
in src/OpenSearch/Connections/Connection.php
69 16 1
public function renderClass()
in util/Endpoint.php
60 14 0
public function renderClass()
in util/ClientEndpoint.php
59 11 0
private function skip()
in util/ActionTest.php
53 15 1
public function __construct()
in src/OpenSearch/Connections/Connection.php
49 9 6
public function getParamWhitelist()
in src/OpenSearch/Endpoints/Search.php
47 1 0
public function getParamWhitelist()
in src/OpenSearch/Endpoints/AsyncSearch/Submit.php
46 1 0
private function catch()
in util/ActionTest.php
44 12 2
public function getParamWhitelist()
in src/OpenSearch/Endpoints/UpdateByQuery.php
40 1 0
public function getParamWhitelist()
in src/OpenSearch/Endpoints/DeleteByQuery.php
38 1 0
private function match()
in util/ActionTest.php
36 11 1
private function do()
in util/ActionTest.php
35 8 1
public function __construct()
in util/Endpoint.php
34 3 4
public function performRequest()
in src/OpenSearch/Connections/Connection.php
33 7 6
33 8 0
public function performRequest()
in src/OpenSearch/Transport.php
32 3 5
public function logRequestFail()
in src/OpenSearch/Connections/Connection.php
32 1 3