Missing class import via use statement (line '27', column '23'). Open
$recordSearch = new \App\RecordSearch('YetiForce', 'Accounts', 10);
- 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 '\Tests\Base\C_RecordActions' in method 'testSearch'. Open
$record = \Tests\Base\C_RecordActions::createAccountRecord();
- 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\PrivilegeUpdater' in method 'testSearch'. Open
\App\PrivilegeUpdater::update($record->getId(), $record->getModuleName());
- 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
Remove this commented out code. Open
// $this->logs = $rows = $recordSearch->search();
- Read upRead up
- Exclude checks
Programmers should not comment out code as it bloats programs and reduces readability.
Unused code should be deleted and can be retrieved from source control history if required.
See
- MISRA C:2004, 2.4 - Sections of code should not be "commented out".
- MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
- MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
- MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"
Remove this commented out code. Open
// $recordSearch->operator = 'FulltextWord';
- Read upRead up
- Exclude checks
Programmers should not comment out code as it bloats programs and reduces readability.
Unused code should be deleted and can be retrieved from source control history if required.
See
- MISRA C:2004, 2.4 - Sections of code should not be "commented out".
- MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
- MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
- MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"
Call to undeclared method \Tests\App\RecordSearch::assertNotEmpty
Open
$this->assertNotEmpty($rows);
- Exclude checks
Call to undeclared method \Tests\App\RecordSearch::assertNotFalse
Open
$this->assertNotFalse($key);
- Exclude checks
Call to undeclared method \Tests\App\RecordSearch::assertEquals
Open
$this->assertEquals('YetiForce S.A.', $rows[$key]['label'], "Not found '$key' ({$record->getId()}) in" . print_r($rows, true));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->assertArrayHasKey($record->getId(), $rows, 'Record id not found');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->logs = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $recordSearch->operator = 'FulltextWord';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotEmpty($rows);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $row = reset($rows);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->assertArrayHasKey($record->getId(), $rows, 'Record id not found');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordSearch->operator = 'FulltextBegin';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = array_search($record->getId(), array_column($rows, 'crmid'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->assertNotEmpty($rows);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordSearch = new \App\RecordSearch('YetiForce', 'Accounts', 10);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->assertEquals('YetiForce S.A.', $row['searchlabel']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$record = \Tests\Base\C_RecordActions::createAccountRecord();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->assertNotEmpty($rows);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->logs = $rows = $recordSearch->search();
- Exclude checks
Spaces must 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->assertArrayHasKey('matcher', $row);
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
$this->assertEquals('YetiForce S.A.', $rows[$key]['label'], "Not found '$key' ({$record->getId()}) in" . print_r($rows, true));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->logs = $rows = $recordSearch->search();
- Exclude checks
Spaces must 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->logs = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertEquals('YetiForce S.A.', $rows[$key]['label'], "Not found '$key' ({$record->getId()}) in" . print_r($rows, true));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Record search test.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->logs = $rows = $recordSearch->search();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $this->assertEquals('YetiForce S.A.', $row['searchlabel']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\PrivilegeUpdater::update($record->getId(), $record->getModuleName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordSearch->setMode(\App\RecordSearch::LABEL_MODE);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->assertNotFalse($key);
- Exclude checks
Spaces must 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 testSearch()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// $row = reset($rows);
- Exclude checks