Function getLicenseInformation
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public static function getLicenseInformation($dir, $libraryName)
{
$licenseError = false;
$returnLicense = '';
$licenseToDisplay = '';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getVendorLibraries
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public static function getVendorLibraries()
{
$libraries = [];
if (file_exists(ROOT_DIRECTORY . '/composer.lock')) {
$composerLock = \App\Json::decode(file_get_contents(ROOT_DIRECTORY . '/composer.lock'), true);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The class Credits has an overall complexity of 56 which is very high. The configured complexity threshold is 50. Open
class Credits
{
/**
* Library json files.
*
- Exclude checks
Function getYarnLibraries
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function getYarnLibraries(string $integrityFile, string $srcDir): array
{
$libraries = [];
if (file_exists($integrityFile)) {
$yarnFile = \App\Json::decode(file_get_contents($integrityFile), true);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getLicenseInformation
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getLicenseInformation($dir, $libraryName)
{
$licenseError = false;
$returnLicense = '';
$licenseToDisplay = '';
Function getLibraryValues
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getLibraryValues($name, $dir): array
{
$library = ['name' => $name, 'version' => '', 'license' => '', 'homepage' => ''];
$existJsonFiles = true;
foreach (self::$jsonFiles as $file) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getBasicLibraries
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getBasicLibraries(): array
{
return [
'YetiForce' => [
'name' => 'YetiForce',
Method getVendorLibraries
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getVendorLibraries()
{
$libraries = [];
if (file_exists(ROOT_DIRECTORY . '/composer.lock')) {
$composerLock = \App\Json::decode(file_get_contents(ROOT_DIRECTORY . '/composer.lock'), true);
Method getLibraryValues
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getLibraryValues($name, $dir): array
{
$library = ['name' => $name, 'version' => '', 'license' => '', 'homepage' => ''];
$existJsonFiles = true;
foreach (self::$jsonFiles as $file) {
Function validateLicenseName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function validateLicenseName($license)
{
if (!$license) {
return true;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method getVendorLibraries() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
public static function getVendorLibraries()
{
$libraries = [];
if (file_exists(ROOT_DIRECTORY . '/composer.lock')) {
$composerLock = \App\Json::decode(file_get_contents(ROOT_DIRECTORY . '/composer.lock'), true);
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getLicenseInformation() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
public static function getLicenseInformation($dir, $libraryName)
{
$licenseError = false;
$returnLicense = '';
$licenseToDisplay = '';
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Refactor this function to reduce its Cognitive Complexity from 41 to the 15 allowed. Open
public static function getLicenseInformation($dir, $libraryName)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 24 to the 15 allowed. Open
public static function getYarnLibraries(string $integrityFile, string $srcDir): array
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 30 to the 15 allowed. Open
public static function getVendorLibraries()
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Avoid using static access to class '\App\Json' in method 'getYarnLibraries'. Open
$yarnFile = \App\Json::decode(file_get_contents($integrityFile), true);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getLicenseInformation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$licenseError = self::validateLicenseName($license);
$returnLicense = $license;
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method getLicenseInformation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$returnLicense = implode(', ', $license);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Json' in method 'getVendorLibraries'. Open
$composerLock = \App\Json::decode(file_get_contents(ROOT_DIRECTORY . '/composer.lock'), true);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getLicenseInformation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (isset(static::$licenses[$libraryName])) {
$returnLicense = static::$licenses[$libraryName];
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $returnLicense . '.txt');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method getLicenseInformation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (isset(static::$licenses[$libraryName])) {
$returnLicense = static::$licenses[$libraryName];
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $returnLicense . '.txt');
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Json' in method 'getLicenseInformation'. Open
$packageFileContent = \App\Json::decode(file_get_contents($packageFile), true);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
The method getVendorLibraries uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$libraries[$package['name']]['license'] = $package['license'][0];
$libraries[$package['name']]['showLicenseModal'] = self::checkIfLicenseFileExists($package['license'][0]);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Json' in method 'getVueLibs'. Open
foreach (\App\Json::read($file) as $name => $libDetails) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Json' in method 'getLibraryValues'. Open
$packageFileContent = \App\Json::decode(file_get_contents($packageFile), true);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Version' in method 'getBasicLibraries'. Open
'version' => \App\Version::get(),
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "homepage" 16 times. Open
'homepage' => 'https://yetiforce.com/en/yetiforce/license',
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "licenses" 6 times. Open
$license = $packageFileContent['license'] ?? $packageFileContent['licenses'] ?? '';
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "notPackageFile" 4 times. Open
'notPackageFile' => true,
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "licenseError" 3 times. Open
$libraries[$package['name']]['licenseError'] = true;
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "licenseToDisplay" 3 times. Open
$library['licenseToDisplay'] = $license['licenseToDisplay'];
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "description" 3 times. Open
'description' => 'LBL_VTIGER_DESCRIPTION',
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "license" 19 times. Open
'license' => 'YetiForce Public License 6.5',
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "showLicenseModal" 9 times. Open
'showLicenseModal' => true,
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "version" 12 times. Open
'version' => \App\Version::get(),
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Avoid unused local variables such as '$page'. Open
foreach ($yarnFile['lockfileEntries'] as $nameWithVersion => $page) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Argument 2 (objectDecodeType)
is true
but \App\Json::decode()
takes int
defined at /code/app/Json.php:37
Open
$composerLock = \App\Json::decode(file_get_contents(ROOT_DIRECTORY . '/composer.lock'), true);
- Exclude checks
Argument 2 (objectDecodeType)
is true
but \App\Json::decode()
takes int
defined at /code/app/Json.php:37
Open
$packageFileContent = \App\Json::decode(file_get_contents($packageFile), true);
- Exclude checks
Argument 2 (objectDecodeType)
is true
but \App\Json::decode()
takes int
defined at /code/app/Json.php:37
Open
$packageFileContent = \App\Json::decode(file_get_contents($packageFile), true);
- Exclude checks
Argument 2 (objectDecodeType)
is true
but \App\Json::decode()
takes int
defined at /code/app/Json.php:37
Open
$yarnFile = \App\Json::decode(file_get_contents($integrityFile), true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'bootstrap-tabdrop' => 'Apache-2.0',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ckeditor/ckeditor' => 'MPL-1.1+',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'html5shiv' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => 'Vtiger',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Information about libraries license.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'block-ui' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Vtiger' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'showLicenseModal' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'LBL_VTIGER_DESCRIPTION',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'license' => 'SPL-1.1.2',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Library json files.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getBasicLibraries(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'YetiForce' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'version' => '',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'nette/utils' => 'BSD-3-Clause',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'domhandler' => 'BSD-2-Clause',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'license' => 'YetiForce Public License 6.5',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'homepage' => 'https://yetiforce.com/en/yetiforce/license',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Sugar' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $licenses = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'color-convert' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'@mdi/font' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'notPackageFile' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => 'Sugar CRM',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'domutils' => 'BSD-2-Clause',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'notPackageFile' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'showLicenseModal' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'version' => '6.4.0 rev. 14548',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function gets libraries name from public_html.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($yarnFile && $yarnFile['lockfileEntries']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$name] = self::getLibraryValues($name, $srcDir);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (\App\Json::read($file) as $name => $libDetails) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$packageFile = $dir . $name . \DIRECTORY_SEPARATOR . $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => 'YetiForce',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ChatSound' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => 'Notification Sounds - Time Is Now',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'license' => 'CC-BY-4.0',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($composerLock['packages'] as $package) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'public_html' . \DIRECTORY_SEPARATOR . 'libraries' . \DIRECTORY_SEPARATOR
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $dir
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
$libraries[$package['name']]['homepage'] = $package['homepage'] ?? 'https://packagist.org/packages/' . $package['name'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['homepage'] = 'https://packagist.org/packages/' . $package['name'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getYarnLibraries(string $integrityFile, string $srcDir): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isPrefix = 0 === strpos($nameWithVersion, '@');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists($file)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$existJsonFiles = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'fontawesome-web' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraryDir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'vendor' . \DIRECTORY_SEPARATOR;
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
$libraries[$package['name']]['showLicenseModal'] = self::checkIfLicenseFileExists($package['license'][0]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($yarnFile['lockfileEntries'] as $nameWithVersion => $page) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $jsonFiles = ['package.json', 'composer.json', 'bower.json'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Information about forks CRM.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'version' => \App\Version::get(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'license' => 'VPL 1.1', 'homepage' => 'https://www.vtiger.com/',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'version' => '',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($package['homepage'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getVueLibs(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function return library values.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'notPackageFile' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($package['version'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['licenseError'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'notPackageFile' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'showLicenseModal' => false,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getVendorLibraries()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($composerLock && $composerLock['packages']) {
- Exclude checks
Line exceeds 120 characters; contains 146 characters Open
ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'public_html' . \DIRECTORY_SEPARATOR . 'libraries' . \DIRECTORY_SEPARATOR . '.yarn-integrity',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$file = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'app_data' . \DIRECTORY_SEPARATOR . 'libraries.json';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$existJsonFiles = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($packageFileContent['version']) && empty($library['version'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($packageFileContent['homepage']) && empty($library['homepage'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'homepage' => 'https://www.sugarcrm.com/',
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
$libraries[$package['name']]['showLicenseModal'] = self::checkIfLicenseFileExists(static::$licenses[$package['name']]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::getYarnLibraries(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'public_html' . \DIRECTORY_SEPARATOR . 'libraries' . \DIRECTORY_SEPARATOR . '.yarn-integrity',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($libraries[$name]['homepage'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var string[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'jquery-lazy' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'showLicenseModal' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['showLicenseModal'] = self::checkIfLicenseFileExists($package['license'][0]);
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
$libraries[$package['name']]['license'] = static::$licenses[$package['name']] . ' [' . $libraries[$package['name']]['license'] . ']';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$name]['homepage'] = "https://yarnpkg.com/en/package/{$name}";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$library['version'] = $packageFileContent['version'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'@fortawesome/fontawesome-free' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'jquery-slimscroll' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'nette/php-generator' => 'BSD-3-Clause',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'@vue/compiler-sfc' => 'MIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], ];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['version'] = $package['version'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['license'] = $package['license'][0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$name] = $libDetails;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$library = ['name' => $name, 'version' => '', 'license' => '', 'homepage' => ''];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$library['homepage'] = $packageFileContent['homepage'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$library['showLicenseModal'] = $license['showLicenseModal'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getLicenseInformation($dir, $libraryName)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$returnLicense = static::$licenses[$libraryName];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$license) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'LBL_SUGAR_DESCRIPTION',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\count($package['license']) > 1) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['licenseError'] = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $libraries;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function gets vue libraries name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getLibraryValues($name, $dir): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$licenseError = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$packageFileContent = \App\Json::decode(file_get_contents($packageFile), true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function checkIfLicenseFileExists($license)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filePath = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $license . '.txt';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function returns information abouts libraries.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'description' => 'LBL_CHAT_SOUND_DESCRIPTION',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function gets libraries from vendor.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$composerLock = \App\Json::decode(file_get_contents(ROOT_DIRECTORY . '/composer.lock'), true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']] = self::getLibraryValues($package['name'], $libraryDir);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $libraries;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists($packageFile)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$license = self::getLicenseInformation($dir, $name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$returnLicense = $license;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function checks if license file existsF.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['license'] = implode(', ', $package['license']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(static::$licenses[$package['name']])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getPublicLibraries()
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'public_html' . \DIRECTORY_SEPARATOR . 'libraries' . \DIRECTORY_SEPARATOR
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'homepage' => 'https://notificationsounds.com/notification-sounds/time-is-now-585',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get libraries based on .yarn-integrity file.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($package['license'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists($integrityFile)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['homepage'] = $package['homepage'] ?? 'https://packagist.org/packages/' . $package['name'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tempName = explode('@', $isPrefix ? ltrim($nameWithVersion, '@') : $nameWithVersion);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (empty($libraries[$package['name']]['homepage'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $integrityFile
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $srcDir
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$name .= array_shift($tempName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$library['licenseToDisplay'] = $license['licenseToDisplay'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function return license information for library.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($license) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$returnLicense = implode(', ', $license);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(static::$licenses[$libraryName]) && $returnLicense) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$licenseToDisplay = static::$licenses[$libraryName];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\is_array($license)) {
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $returnLicense . '.txt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $returnLicense . '.txt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(static::$licenses[$libraryName])) {
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $returnLicense . '.txt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array|string $license
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $dir
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($returnLicense) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(static::$licenses[$libraryName])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists(ROOT_DIRECTORY . '/composer.lock')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['showLicenseModal'] = self::checkIfLicenseFileExists(static::$licenses[$package['name']]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::$jsonFiles as $file) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$returnLicense = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$showLicenseModal = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$licenseError = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function validateLicenseName($license)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\is_array($license)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$license = [$license];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $result;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($existJsonFiles) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$licenseToDisplay = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$licenseError = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getCredits()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ['static' => self::getBasicLibraries(), 'vendor' => self::getVendorLibraries(), 'public' => self::getPublicLibraries(), 'vue' => self::getVueLibs()];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$packageFile = $dir . $libraryName . \DIRECTORY_SEPARATOR . $file;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($license[0]['type'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($license as $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($license['license'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\count($license) > 1) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function check correct of license.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (stripos($value, 'and') || stripos($value, ' or ') || null === $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$libraries[$package['name']]['license'] = static::$licenses[$package['name']] . ' [' . $libraries[$package['name']]['license'] . ']';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $libraries;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$yarnFile = \App\Json::decode(file_get_contents($integrityFile), true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$name = $isPrefix ? '@' : '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\is_dir($srcDir . $name)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$packageFileContent = \App\Json::decode(file_get_contents($packageFile), true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$library['packageFileMissing'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$license = $packageFileContent['license'] ?? $packageFileContent['licenses'] ?? '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$returnLicense = $license['type'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $returnLicense . '.txt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$library['license'] = $license['license'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (file_exists($packageFile)) {
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $returnLicense . '.txt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $libraryName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::$jsonFiles as $file) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$returnLicense = implode(', ', array_column($license, 'type'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Line exceeds 120 characters; contains 153 characters Open
return ['license' => $returnLicense, 'error' => $licenseError, 'licenseToDisplay' => $licenseToDisplay, 'showLicenseModal' => $showLicenseModal];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $library;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($license['type'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$licenseError = self::validateLicenseName($license);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$returnLicense = static::$licenses[$libraryName] . " [{$returnLicense}]";
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $licenseToDisplay . '.txt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $returnLicense . '.txt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ['license' => $returnLicense, 'error' => $licenseError, 'licenseToDisplay' => $licenseToDisplay, 'showLicenseModal' => $showLicenseModal];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$library['licenseError'] = $license['error'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$returnLicense = static::$licenses[$libraryName];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $license
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$showLicenseModal = file_exists($dir . '..' . \DIRECTORY_SEPARATOR . 'licenses' . \DIRECTORY_SEPARATOR . $licenseToDisplay . '.txt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return file_exists($filePath);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
return ['static' => self::getBasicLibraries(), 'vendor' => self::getVendorLibraries(), 'public' => self::getPublicLibraries(), 'vue' => self::getVueLibs()];
- Exclude checks