Function testIfAllOperatorsExist
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function testIfAllOperatorsExist()
{
foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
if ($item->isFile() && 'php' === $item->getExtension()) {
$fileName = $item->getBasename('.php');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method testCheckConditions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testCheckConditions()
{
$recordModel = \Tests\Base\C_RecordActions::createSQuotesRecord();
$checkConditions = \App\Condition::checkConditions([
'condition' => 'AND',
Method testIfAllOperatorsExist
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testIfAllOperatorsExist()
{
foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
if ($item->isFile() && 'php' === $item->getExtension()) {
$fileName = $item->getBasename('.php');
The method testIfAllOperatorsExist() has an NPath complexity of 327. The configured NPath complexity threshold is 200. Open
public function testIfAllOperatorsExist()
{
foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
if ($item->isFile() && 'php' === $item->getExtension()) {
$fileName = $item->getBasename('.php');
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method testIfAllOperatorsExist() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10. Open
public function testIfAllOperatorsExist()
{
foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
if ($item->isFile() && 'php' === $item->getExtension()) {
$fileName = $item->getBasename('.php');
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Refactor this function to reduce its Cognitive Complexity from 34 to the 15 allowed. Open
public function testIfAllOperatorsExist()
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Missing class import via use statement (line '28', column '17'). Open
foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
- 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
Avoid using static access to class '\Vtiger_Loader' in method 'testIfAllOperatorsExist'. Open
$className = \Vtiger_Loader::getComponentClassName('UIType', $fileName, 'Vtiger', false);
- 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 '\Tests\Base\C_RecordActions' in method 'testCheckConditions'. Open
$recordModel = \Tests\Base\C_RecordActions::createSQuotesRecord();
- 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\Condition' in method 'testCheckConditions'. Open
$checkConditions = \App\Condition::checkConditions([
'condition' => 'AND',
'rules' => [
[
'fieldname' => 'createdtime:SQuotes',
- 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\Condition' in method 'testCheckConditions'. Open
$checkConditions = \App\Condition::checkConditions([
'condition' => 'AND',
'rules' => [
[
'fieldname' => 'createdtime:SQuotes',
- 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 "value" 4 times. Open
'value' => date('Y-m-d H:i:s', strtotime('last day')) . ',' . date('Y-m-d H:i:s', strtotime('next day')),
- 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 "Y-m-d H:i:s" 4 times. Open
'value' => date('Y-m-d H:i:s', strtotime('last day')) . ',' . date('Y-m-d H:i:s', strtotime('next day')),
- 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 "Class not found: " 3 times. Open
$this->assertTrue(class_exists($className), 'Class not found: ' . $className);
- 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 "fieldname" 4 times. Open
'fieldname' => 'createdtime:SQuotes',
- 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 "operator" 6 times. Open
$fn = 'operator' . ucfirst($operator);
- 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.
Call to undeclared method \Tests\App\Conditions::assertTrue
Open
$this->assertTrue(\in_array($fn, $methodsQueryFields), "No query operator $operator (function $fn) in class $classNameQueryFields");
- Exclude checks
Call to undeclared method \Tests\App\Conditions::assertFalse
Open
$this->assertFalse($checkConditions);
- Exclude checks
Call to undeclared method \Tests\App\Conditions::assertTrue
Open
$this->assertTrue(\in_array($fn, $methodsRecordFields), "No record operator $operator (function $fn) in class $classNameRecordFields");
- Exclude checks
Call to undeclared method \Tests\App\Conditions::assertTrue
Open
$this->assertTrue(class_exists($className), 'Class not found: ' . $className);
- Exclude checks
Call to undeclared method \Tests\App\Conditions::assertTrue
Open
$this->assertTrue(class_exists($classNameQueryFields), 'Class not found: ' . $classNameQueryFields);
- Exclude checks
Call to undeclared method \Tests\App\Conditions::assertTrue
Open
$this->assertTrue($checkConditions);
- Exclude checks
Call to undeclared method \Tests\App\Conditions::assertTrue
Open
$this->assertTrue(class_exists($classNameRecordFields), 'Class not found: ' . $classNameRecordFields);
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
$checkConditions = \App\Condition::checkConditions([
'condition' => 'AND',
'rules' => [
[
'fieldname' => 'createdtime:SQuotes',
- 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 109.
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
$checkConditions = \App\Condition::checkConditions([
'condition' => 'AND',
'rules' => [
[
'fieldname' => 'createdtime:SQuotes',
- 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 109.
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
foreach ($instance->getRecordOperators() as $operator) {
$fn = 'operator' . ucfirst($operator);
if ($methodsRecordFields && !\in_array($fn, $methodsRecordFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
$fn = 'getStdOperator';
}
- 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 102.
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
foreach ($instance->getQueryOperators() as $operator) {
$fn = 'operator' . ucfirst($operator);
if ($methodsQueryFields && !\in_array($fn, $methodsQueryFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
$fn = 'getStdOperator';
}
- 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 102.
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 excessively long variable names like $classNameRecordFields. Keep variable name length under 20. Open
$classNameRecordFields = '\App\Conditions\RecordFields\\' . $fileName . 'Field';
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
$fn = 'operator' . ucfirst($operator);
- 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
if ($item->isFile() && 'php' === $item->getExtension()) {
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$methodsRecordFields = class_exists($classNameRecordFields) ? get_class_methods($classNameRecordFields) : [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing check conditions.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], $recordModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'fieldname' => 'createdtime:SQuotes',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'fieldname' => 'subject:SQuotes',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function testIfAllOperatorsExist()
- Exclude checks
Line exceeds 120 characters; contains 156 characters Open
$this->assertTrue(\in_array($fn, $methodsQueryFields), "No query operator $operator (function $fn) in class $classNameQueryFields");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue(class_exists($classNameRecordFields), 'Class not found: ' . $classNameRecordFields);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
if ($methodsQueryFields && !\in_array($fn, $methodsQueryFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'condition' => 'AND',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'rules' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'operator' => 'bw',
- Exclude checks
Spaces must 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
$fn = 'operator' . ucfirst($operator);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($methodsQueryFields && !\in_array($fn, $methodsQueryFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'condition' => 'AND',
- Exclude checks
Spaces must 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 ($methodsQueryFields) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$methodsRecordFields = class_exists($classNameRecordFields) ? get_class_methods($classNameRecordFields) : [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($methodsRecordFields && !\in_array($fn, $methodsRecordFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
- Exclude checks
Spaces must 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 ($instance->getQueryOperators() as $operator) {
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
'value' => date('Y-m-d H:i:s', strtotime('last day')) . ',' . date('Y-m-d H:i:s', strtotime('next day')),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Testing constructor method.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\AppException
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($instance->getRecordOperators() as $operator) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Tests\Base\C_RecordActions::createSQuotesRecord();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$checkConditions = \App\Condition::checkConditions([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'operator' => 'bw',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'value' => date('Y-m-d H:i:s', strtotime('last day')) . ',' . date('Y-m-d H:i:s', strtotime('next day')),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'operator' => 'e',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue($checkConditions);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertFalse($checkConditions);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @codeCoverageIgnore
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$classNameQueryFields = '\App\Conditions\QueryFields\\' . $fileName . 'Field';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fn = 'getStdOperator';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'rules' => [
- Exclude checks
Spaces must 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->assertTrue(class_exists($className), 'Class not found: ' . $className);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue(class_exists($classNameQueryFields), 'Class not found: ' . $classNameQueryFields);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($methodsRecordFields) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue(\in_array($fn, $methodsRecordFields), "No record operator $operator (function $fn) in class $classNameRecordFields");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
], $recordModel);
- Exclude checks
Spaces must 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
'fieldname' => 'createdtime:SQuotes',
- Exclude checks
Spaces must 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 ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$methodsQueryFields = class_exists($classNameQueryFields) ? get_class_methods($classNameQueryFields) : [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fn = 'operator' . ucfirst($operator);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$methodsQueryFields = class_exists($classNameQueryFields) ? get_class_methods($classNameQueryFields) : [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertTrue(\in_array($fn, $methodsQueryFields), "No query operator $operator (function $fn) in class $classNameQueryFields");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$classNameRecordFields = '\App\Conditions\RecordFields\\' . $fileName . 'Field';
- Exclude checks
Spaces must 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' => 'System CRM YetiForce',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'value' => date('Y-m-d H:i:s', strtotime('next day')) . ',' . date('Y-m-d H:i:s', strtotime('next year')),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'operator' => 'e',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$className = \Vtiger_Loader::getComponentClassName('UIType', $fileName, 'Vtiger', false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fn = 'getStdOperator';
- Exclude checks
Spaces must 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
'fieldname' => 'subject:SQuotes',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$checkConditions = \App\Condition::checkConditions([
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
'value' => date('Y-m-d H:i:s', strtotime('next day')) . ',' . date('Y-m-d H:i:s', strtotime('next year')),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileName = $item->getBasename('.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance = new $className();
- Exclude checks
Spaces must 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 testCheckConditions()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'value' => 'System CRM YetiForce',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
if ($methodsRecordFields && !\in_array($fn, $methodsRecordFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
- Exclude checks
Line exceeds 120 characters; contains 159 characters Open
$this->assertTrue(\in_array($fn, $methodsRecordFields), "No record operator $operator (function $fn) in class $classNameRecordFields");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[
- Exclude checks