File Watchdog.php
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* YetiForce watchdog class.
* Modifying this file or functions that affect the footer appearance will violate the license terms!!!
*
The class Watchdog has an overall complexity of 77 which is very high. The configured complexity threshold is 50. Open
class Watchdog
{
/**
* Allowed flags array.
*
- Exclude checks
Watchdog
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Watchdog
{
/**
* Allowed flags array.
*
Method send
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function send()
{
$config = \App\Config::component('YetiForce');
if (empty($config['watchdogUrl']) || !\App\RequestUtil::isNetConnection()) {
return;
Function getEnvironment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getEnvironment()
{
if (empty($this->cache['environment'])) {
$this->cache['environment'] = \App\Utils\ConfReport::get('environment');
}
- 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 getLibraries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getLibraries()
{
if (empty($this->cache['libraries'])) {
$this->cache['libraries'] = \App\Utils\ConfReport::get('libraries');
}
- 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 getWritableFilesAndFolders
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getWritableFilesAndFolders()
{
if (empty($this->cache['writableFilesAndFolders'])) {
$this->cache['writableFilesAndFolders'] = \App\Utils\ConfReport::get('writableFilesAndFolders');
}
- 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 send
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function send()
{
$config = \App\Config::component('YetiForce');
if (empty($config['watchdogUrl']) || !\App\RequestUtil::isNetConnection()) {
return;
- 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 getSecurity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getSecurity()
{
if (empty($this->cache['security'])) {
$this->cache['security'] = \App\Utils\ConfReport::get('security');
}
- 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 getPublicDirectoryAccess
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPublicDirectoryAccess()
{
if (empty($this->cache['publicDirectoryAccess'])) {
$this->cache['publicDirectoryAccess'] = \App\Utils\ConfReport::get('publicDirectoryAccess');
}
- 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 getDatabase
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getDatabase()
{
if (empty($this->cache['database'])) {
$this->cache['database'] = \App\Utils\ConfReport::get('database');
}
- 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 getPerformance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPerformance()
{
if (empty($this->cache['performance'])) {
$this->cache['performance'] = \App\Utils\ConfReport::get('performance');
}
- 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 getStability
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getStability()
{
if (empty($this->cache['stability'])) {
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
}
- 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
Class "Watchdog" has 23 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class Watchdog
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
The class Watchdog has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13. Open
class Watchdog
{
/**
* Allowed flags array.
*
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Missing class import via use statement (line '80', column '9'). Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->post($url, [
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Duplicated array key version, first declared at line 153. Open
$value = [
'version' => $dbInfo['serverVersion'],
'comment' => $dbInfo['version_comment'] ?? '',
'clientVersion' => $dbInfo['clientVersion'],
'typeDb' => $dbInfo['typeDb'],
- Read upRead up
- Exclude checks
DuplicatedArrayKey
Defining another value for the same key in an array literal overrides the previous key/value, which makes it effectively an unused code. If it's known from the beginning that the key will have different value, there is usually no point in defining first one.
Example
function createArray() {
return [
'non-associative 0element', // not applied
0 => 'associative 0-element', // applied
false => 'associative 0-element', // applied
'foo' => 'bar', // not applied
"foo" => 'baz', // applied
];
}
Source http://phpmd.org/rules/cleancode.html#duplicatedarraykey
Avoid using static access to class '\App\RequestHttp' in method 'send'. Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->post($url, [
- 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\Log' in method 'send'. Open
\App\Log::beginProfile("POST|Watchdog::send|{$url}", __NAMESPACE__);
- 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 assigning values to variables in if clauses and the like (line '147', column '65'). Open
public function getDbVersion()
{
$value = [];
if (($db = \App\Db::getInstance()) && $db->getMasterPdo() && ($dbInfo = $db->getInfo())) {
$value = [
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Utils\ConfReport' in method 'getLastCronTime'. Open
$cron = \App\Utils\ConfReport::getCronVariables('last_start');
- 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 '\Settings_Updates_Module_Model' in method 'getUpdates'. Open
foreach (\Settings_Updates_Module_Model::getUpdates() as $row) {
- 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\Utils\ConfReport' in method 'getSecurity'. Open
$this->cache['security'] = \App\Utils\ConfReport::get('security');
- 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\Utils\ConfReport' in method 'getEnvironment'. Open
$this->cache['environment'] = \App\Utils\ConfReport::get('environment');
- 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\Utils\ConfReport' in method 'getWritableFilesAndFolders'. Open
$this->cache['writableFilesAndFolders'] = \App\Utils\ConfReport::get('writableFilesAndFolders');
- 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\Log' in method 'send'. Open
\App\Log::warning('Not possible to connect to the server status' . PHP_EOL . $e->getMessage(), 'YetiForceStatus');
- 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\Utils\ConfReport' in method 'getPerformance'. Open
$this->cache['performance'] = \App\Utils\ConfReport::get('performance');
- 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\Db' in method 'getDbVersion'. Open
if (($db = \App\Db::getInstance()) && $db->getMasterPdo() && ($dbInfo = $db->getInfo())) {
- 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\Utils\Backup' in method 'getSpaceBackup'. Open
$dir = \App\Utils\Backup::getBackupCatalogPath();
- 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\Utils\ConfReport' in method 'getDatabase'. Open
$this->cache['database'] = \App\Utils\ConfReport::get('database');
- 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\Log' in method 'send'. Open
\App\Log::endProfile("POST|Watchdog::send|{$url}", __NAMESPACE__);
- 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\Utils\ConfReport' in method 'getPublicDirectoryAccess'. Open
$this->cache['publicDirectoryAccess'] = \App\Utils\ConfReport::get('publicDirectoryAccess');
- 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\YetiForce\Register' in method 'send'. Open
'insKey' => \App\YetiForce\Register::getInstanceKey(),
- 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\Config' in method 'getDomain'. Open
return \App\Config::main('site_URL');
- 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\Config' in method 'send'. Open
$config = \App\Config::component('YetiForce');
- 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\Config' in method 'getAll'. Open
$config = \App\Config::component('YetiForce');
- 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\Fields\File' in method 'getSpaceTemp'. Open
$dir = \App\Fields\File::getTmpPath();
- 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 assigning values to variables in if clauses and the like (line '147', column '8'). Open
public function getDbVersion()
{
$value = [];
if (($db = \App\Db::getInstance()) && $db->getMasterPdo() && ($dbInfo = $db->getInfo())) {
$value = [
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Utils\ConfReport' in method 'getLibraries'. Open
$this->cache['libraries'] = \App\Utils\ConfReport::get('libraries');
- 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\Utils\ConfReport' in method 'getPathVerification'. Open
$this->cache['pathVerification'] = \App\Utils\ConfReport::get('pathVerification');
- 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\RequestUtil' in method 'send'. Open
if (empty($config['watchdogUrl']) || !\App\RequestUtil::isNetConnection()) {
- 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\Utils\ConfReport' in method 'getStability'. Open
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
- 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\Utils\ConfReport' in method 'getPhpVersion'. Open
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
- 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 'getCrmVersion'. Open
return \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 "version" 4 times. Open
'version' => $dbInfo['serverVersion'],
- 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 "status" 18 times. Open
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- 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 "watchdogUrl" 4 times. Open
'watchdogUrl' => 'string',
- 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 "stability" 12 times. Open
'stability' => 'bool',
- 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 "libraries" 5 times. Open
'libraries' => 'bool',
- 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 "environment" 5 times. Open
'environment' => 'bool',
- 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 "pathVerification" 5 times. Open
'pathVerification' => 'bool',
- 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 "writableFilesAndFolders" 5 times. Open
'writableFilesAndFolders' => 'bool',
- 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 "recommended" 21 times. Open
if (isset($values['recommended'])) {
- 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 "security" 5 times. Open
'security' => 'bool',
- 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 "publicDirectoryAccess" 5 times. Open
'publicDirectoryAccess' => 'bool',
- 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 "performance" 5 times. Open
'performance' => 'bool',
- 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 "database" 5 times. Open
'database' => 'bool',
- 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 "phpVersion" 5 times. Open
'phpVersion' => 'bool',
- 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.
Returning type '-'
but getLastCronTime()
is declared to return array
Open
return $value;
- Exclude checks
Returning type false|float
but getSpaceBackup()
is declared to return array
Open
return (empty($dir) || !is_dir($dir)) ? 0 : disk_free_space($dir);
- Exclude checks
Call to method getCronVariables
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$cron = \App\Utils\ConfReport::getCronVariables('last_start');
- Exclude checks
Returning type false|float
but getSpaceTemp()
is declared to return array
Open
return is_dir($dir) ? disk_free_space($dir) : 0;
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
- Exclude checks
Returning type false|float
but getSpaceRoot()
is declared to return array
Open
return is_dir($dir) ? disk_free_space($dir) : 0;
- Exclude checks
Call to method beginProfile
from undeclared class \App\Log
Open
\App\Log::beginProfile("POST|Watchdog::send|{$url}", __NAMESPACE__);
- Exclude checks
Call to method endProfile
from undeclared class \App\Log
Open
\App\Log::endProfile("POST|Watchdog::send|{$url}", __NAMESPACE__);
- Exclude checks
Call to method warning
from undeclared class \App\Log
Open
\App\Log::warning('Not possible to connect to the server status' . PHP_EOL . $e->getMessage(), 'YetiForceStatus');
- Exclude checks
Returning type string
but getCrmVersion()
is declared to return array
Open
return \App\Version::get();
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['writableFilesAndFolders'] = \App\Utils\ConfReport::get('writableFilesAndFolders');
- Exclude checks
Call to undeclared method \App\Db::getMasterPdo
Open
if (($db = \App\Db::getInstance()) && $db->getMasterPdo() && ($dbInfo = $db->getInfo())) {
- Exclude checks
Returning type false|float
but getSpaceStorage()
is declared to return array
Open
return is_dir($dir) ? disk_free_space($dir) : 0;
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['security'] = \App\Utils\ConfReport::get('security');
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['database'] = \App\Utils\ConfReport::get('database');
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['performance'] = \App\Utils\ConfReport::get('performance');
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['environment'] = \App\Utils\ConfReport::get('environment');
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['pathVerification'] = \App\Utils\ConfReport::get('pathVerification');
- Exclude checks
Reference to static property testCli
from undeclared class \App\Utils\ConfReport
Open
\App\Utils\ConfReport::$testCli = true;
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
- Exclude checks
Returning type 0
but getSpaceRoot()
is declared to return array
Open
return is_dir($dir) ? disk_free_space($dir) : 0;
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['libraries'] = \App\Utils\ConfReport::get('libraries');
- Exclude checks
Call to method post
from undeclared class \GuzzleHttp\Client
Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->post($url, [
- Exclude checks
Returning type 0
but getSpaceStorage()
is declared to return array
Open
return is_dir($dir) ? disk_free_space($dir) : 0;
- Exclude checks
Call to method get
from undeclared class \App\Utils\ConfReport
(Did you mean class \Tests\Settings\ConfReport) Open
$this->cache['publicDirectoryAccess'] = \App\Utils\ConfReport::get('publicDirectoryAccess');
- Exclude checks
Reference to static property testCli
from undeclared class \App\Utils\ConfReport
Open
\App\Utils\ConfReport::$testCli = false;
- Exclude checks
Returning type 0
but getSpaceTemp()
is declared to return array
Open
return is_dir($dir) ? disk_free_space($dir) : 0;
- Exclude checks
Returning type 0
but getSpaceBackup()
is declared to return array
Open
return (empty($dir) || !is_dir($dir)) ? 0 : disk_free_space($dir);
- Exclude checks
Call to method getInstanceKey
from undeclared class \App\YetiForce\Register
Open
'insKey' => \App\YetiForce\Register::getInstanceKey(),
- Exclude checks
Call to method __construct
from undeclared class \GuzzleHttp\Client
Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->post($url, [
- Exclude checks
Similar blocks of code found in 6 locations. Consider refactoring. Open
public function getStability()
{
if (empty($this->cache['stability'])) {
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
public function getWritableFilesAndFolders()
{
if (empty($this->cache['writableFilesAndFolders'])) {
$this->cache['writableFilesAndFolders'] = \App\Utils\ConfReport::get('writableFilesAndFolders');
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
public function getSecurity()
{
if (empty($this->cache['security'])) {
$this->cache['security'] = \App\Utils\ConfReport::get('security');
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
public function getPerformance()
{
if (empty($this->cache['performance'])) {
$this->cache['performance'] = \App\Utils\ConfReport::get('performance');
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
public function getDatabase()
{
if (empty($this->cache['database'])) {
$this->cache['database'] = \App\Utils\ConfReport::get('database');
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 6 locations. Consider refactoring. Open
public function getPublicDirectoryAccess()
{
if (empty($this->cache['publicDirectoryAccess'])) {
$this->cache['publicDirectoryAccess'] = \App\Utils\ConfReport::get('publicDirectoryAccess');
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 155.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public static $variables = [
'watchdogUrl' => 'string',
'domain' => 'bool',
'phpVersion' => 'bool',
'crmVersion' => 'bool',
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 107.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid variables with short names like $db. Configured minimum length is 3. Open
if (($db = \App\Db::getInstance()) && $db->getMasterPdo() && ($dbInfo = $db->getInfo())) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
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
$config = \App\Config::component('YetiForce');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info[$name] = \call_user_func([$status, 'get' . ucfirst($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 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
* Allowed flags array.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'spaceRoot' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'writableFilesAndFolders' => '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
* Send status informations.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
(new \GuzzleHttp\Client(\App\RequestHttp::getOptions()))->post($url, [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Returns array of all flags with current config.
- 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
'publicDirectoryAccess' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Cache.
- 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
\App\Log::beginProfile("POST|Watchdog::send|{$url}", __NAMESPACE__);
- 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
$status = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($config as $name => $state) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'timeout' => 5,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (static::$variables as $flag => $type) {
- 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
'insKey' => \App\YetiForce\Register::getInstanceKey(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($state) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'allow_redirects' => false,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get php version param.
- 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
'dbVersion' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'spaceStorage' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//ConfReport
- 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
try {
- 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
'database' => '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
public static function send()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Utils\ConfReport::$testCli = 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
\App\Log::warning('Not possible to connect to the server status' . PHP_EOL . $e->getMessage(), 'YetiForceStatus');
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
\App\Log::warning('Not possible to connect to the server status' . PHP_EOL . $e->getMessage(), 'YetiForceStatus');
- 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
'stability' => '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
'json' => $info,
- 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
$config = \App\Config::component('YetiForce');
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
$result[$flag] = ['name' => $flag, 'label' => 'LBL_' . \strtoupper($flag), 'type' => $type, 'value' => $config[$flag] ?? '-'];
- 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
'spaceTemp' => '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
\App\Utils\ConfReport::$testCli = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result[$flag] = ['name' => $flag, 'label' => 'LBL_' . \strtoupper($flag), 'type' => $type, 'value' => $config[$flag] ?? '-'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'lastCronTime' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::endProfile("POST|Watchdog::send|{$url}", __NAMESPACE__);
- 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 getAll()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getPhpVersion()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'watchdogUrl' => 'string',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'updates' => '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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$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
'crmVersion' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'performance' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $cache = [];
- 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 $variables = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'osVersion' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'sapiVersion' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'security' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'libraries' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'pathVerification' => '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
'App-Id' => $info['insKey'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'environment' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$url = $config['watchdogUrl'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($config['watchdogUrl']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'headers' => [
- 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
'domain' => 'bool',
- 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
return;
- 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
'phpVersion' => 'bool',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($config['watchdogUrl']) || !\App\RequestUtil::isNetConnection()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Throwable $e) {
- 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
* Get updates.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Version::get();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'release' => php_uname('r'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSpaceRoot()
- 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
$dir = \App\Utils\Backup::getBackupCatalogPath();
- 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
* @return array
- 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
'comment' => $dbInfo['version_comment'] ?? '',
- 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 is_dir($dir) ? disk_free_space($dir) : 0;
- 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
$rows[] = [$row['name'], $row['from_version'], $row['to_version'], $row['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
* Get database version param.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'version' => $dbInfo['serverVersion'],
- 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 function getLastCronTime()
- 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
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['cron'] = $values['cron'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->cache['stability'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'version' => $dbInfo['version'] ?? '',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'machineType' => php_uname('m'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $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
* @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
$dir = \App\Fields\File::getTmpPath();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get backup directory space.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getUpdates()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rows = [];
- 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 function getSecurity()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->cache['security'] = \App\Utils\ConfReport::get('security');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->cache['security'] as $name => $values) {
- 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
$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
*
- 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 \App\Config::main('site_URL');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $rows;
- 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
$value = '-';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSpaceStorage()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get temporary directory space.
- 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 (empty($dir) || !is_dir($dir)) ? 0 : disk_free_space($dir);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (($db = \App\Db::getInstance()) && $db->getMasterPdo() && ($dbInfo = $db->getInfo())) {
- 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 $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
return [
- 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
* @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
public function getSpaceBackup()
- 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
* Get security param.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param = [];
- 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($this->cache['stability']['phpVersion']['cron'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($cron) {
- 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
$value['www'] = $this->cache['stability']['phpVersion']['www'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get system version param.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'versionSslLibrary' => $dbInfo['version_ssl_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
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getOsVersion()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $cron;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return is_dir($dir) ? disk_free_space($dir) : 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
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cron = \App\Utils\ConfReport::getCronVariables('last_start');
- 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
$value['cron'] = $this->cache['stability']['phpVersion']['cron'];
- 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 function getDbVersion()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeDb' => $dbInfo['typeDb'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'hostName' => php_uname('n'),
- 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
* Get domain.
- 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
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($this->cache['stability']['phpVersion']['www'])) {
- 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
$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
'version' => php_uname('v'),
- 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
* Get storage directory space.
- 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
foreach (\Settings_Updates_Module_Model::getUpdates() as $row) {
- 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($this->cache['security'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['cron'])) {
- 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
* Get os version param.
- 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
$dir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'storage';
- 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 function getCrmVersion()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'full' => php_uname(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'operatingSystem' => php_uname('s'),
- 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 is_dir($dir) ? disk_free_space($dir) : 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSpaceTemp()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getDomain()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->cache['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
$param = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param[$name] = $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
public function getEnvironment()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['cron'])) {
- 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
$value['recommended'] = $values['recommended'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'clientVersion' => $dbInfo['clientVersion'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get last cron time param.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get CRM root directory space.
- 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
if (isset($values['recommended'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['recommended'] = $values['recommended'];
- 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
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- 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 $param;
- 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
$value['recommended'] = $values['recommended'];
- 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[$name] = $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
$this->cache['performance'] = \App\Utils\ConfReport::get('performance');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['cron'] = $values['cron'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->cache['publicDirectoryAccess'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param[$name] = $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
$value['cron'] = $values['cron'];
- 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
* Get writable files and folders param.
- 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($values['cron'])) {
- 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 = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['cron'])) {
- 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 $param;
- 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 ($this->cache['libraries'] as $name => $values) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['mode'])) {
- 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
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['recommended'] = $values['recommended'];
- 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 $param;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->cache['libraries'] = \App\Utils\ConfReport::get('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
if (isset($values['recommended'])) {
- 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
$value['cron'] = $values['cron'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $param;
- 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($this->cache['stability'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->cache['stability'] as $name => $values) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param[$name] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['cron'])) {
- 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
foreach ($this->cache['publicDirectoryAccess'] as $name => $values) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['cron'] = $values['cron'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get environment param.
- 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($values['cron'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['cron'] = $values['cron'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['recommended'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get libraries param.
- 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
$value = ['www' => $values['www'] ?? '', 'status' => $values['status'], 'mandatory' => ($values['mandatory'] ?? false)];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['cron'] = $values['cron'];
- 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
$this->cache['stability'] = \App\Utils\ConfReport::get('stability');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['cron'])) {
- 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($this->cache['environment'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['recommended'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get database param.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['recommended'] = $values['recommended'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param[$name] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getStability()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $param;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get performance param.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->cache['publicDirectoryAccess'] = \App\Utils\ConfReport::get('publicDirectoryAccess');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['mode'] = $values['mode'];
- 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[$name] = $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
* @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
{
- 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
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->cache['writableFilesAndFolders'] = \App\Utils\ConfReport::get('writableFilesAndFolders');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$value = ['www' => $values['www'] ?? '', 'status' => $values['status'], 'mandatory' => ($values['mandatory'] ?? false)];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->cache['performance'] as $name => $values) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['recommended'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value['recommended'] = $values['recommended'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param = [];
- 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 $param;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param[$name] = $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($this->cache['performance'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['recommended'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['mode'])) {
- 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 $param;
- 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 function getLibraries()
- 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
$value['mode'] = $values['mode'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getPerformance()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get security param.
- 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 function getPublicDirectoryAccess()
- 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
$this->cache['environment'] = \App\Utils\ConfReport::get('environment');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->cache['environment'] as $name => $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
public function getWritableFilesAndFolders()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param = [];
- 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($this->cache['writableFilesAndFolders'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->cache['writableFilesAndFolders'] as $name => $values) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get stability param.
- 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
* @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
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- 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
$value['recommended'] = $values['recommended'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSapiVersion()
- 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
return $param;
- 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[$name] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($this->cache['pathVerification'] as $name => $values) {
- 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 function getDatabase()
- 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($values['cron'])) {
- 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
* Get web server name and 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($values['recommended'])) {
- 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
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $param;
- 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
$this->cache['database'] = \App\Utils\ConfReport::get('database');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get database param.
- 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($this->cache['pathVerification'])) {
- 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 [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param = [];
- 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
$value['cron'] = $values['cron'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param[$name] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = ['www' => $values['www'] ?? '', 'status' => $values['status']];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getPathVerification()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->cache['database'])) {
- 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 ($this->cache['database'] as $name => $values) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->cache['pathVerification'] = \App\Utils\ConfReport::get('pathVerification');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$param = [];
- Exclude checks