Showing 160 of 160 total issues
Avoid unused parameters such as '$target'. Open
protected function _any($target, $data = null, $source = null)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Avoid assigning values to variables in if clauses and the like (line '28', column '15'). Open
public function locate()
{
if (!($class = $this->_getClass())) {
throw new RuntimeException(sprintf('Could not locate tests from class: Class must be specified'));
}
- 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 assigning values to variables in if clauses and the like (line '31', column '21'). Open
public function getInnerIterator()
{
if (is_null($iterator = $this->_getInnerIterator())) {
$this->_setInnerIterator($this->_createInnerIterator());
}
- 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 unused parameters such as '$data'. Open
protected function _any($target, $data = null, $source = null)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
The variable $_key is not named in camelCase. Open
public function _arrayMerge($array, $traversable)
{
foreach ($traversable as $_key => $_value) {
$array[$_key] = $_value;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_path is not named in camelCase. Open
protected function _getFilePaths()
{
$results = array();
foreach ($this->_getPathsSpecs() as $_pathExpr) {
$paths = $this->_resolvePathSpec($_pathExpr);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_status is not named in camelCase. Open
protected function _getCalculators()
{
return array(
'assertion_count' => function ($totals, $code, $source) {
if ($source instanceof Assertion\AccountableInterface) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_suite is not named in camelCase. Open
protected function _runAll()
{
$runner = $this->_getRunnerInstance();
$results = array();
foreach ($this->_getSuites() as $_code => $_suite) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_test is not named in camelCase. Open
protected function _runAll($tests)
{
$this->_validateTestList($tests);
$results = array();
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_status is not named in camelCase. Open
protected function _getCalculators()
{
return array(
'assertion_count' => function ($totals, $code, $source) {
if ($source instanceof Assertion\AccountableInterface) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_path is not named in camelCase. Open
public function locate()
{
$items = array();
foreach ($this->_getFilePaths() as $_path) {
$tests = $this->_getFileTests($_path);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_suite is not named in camelCase. Open
protected function _runAll()
{
$runner = $this->_getRunnerInstance();
$results = array();
foreach ($this->_getSuites() as $_code => $_suite) {
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_path is not named in camelCase. Open
public function locate()
{
$items = array();
foreach ($this->_getFilePaths() as $_path) {
$tests = $this->_getFileTests($_path);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_key is not named in camelCase. Open
public function _arrayMerge($array, $traversable)
{
foreach ($traversable as $_key => $_value) {
$array[$_key] = $_value;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_pathExpr is not named in camelCase. Open
protected function _getFilePaths()
{
$results = array();
foreach ($this->_getPathsSpecs() as $_pathExpr) {
$paths = $this->_resolvePathSpec($_pathExpr);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_pathExpr is not named in camelCase. Open
protected function _getFilePaths()
{
$results = array();
foreach ($this->_getPathsSpecs() as $_pathExpr) {
$paths = $this->_resolvePathSpec($_pathExpr);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_method is not named in camelCase. Open
protected function _getClassTests(ReflectionClass $class)
{
$methods = array();
foreach ($class->getMethods() as $_method) {
/* @var $_method ReflectionMethod */
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_value is not named in camelCase. Open
public function _arrayMerge($array, $traversable)
{
foreach ($traversable as $_key => $_value) {
$array[$_key] = $_value;
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_path is not named in camelCase. Open
protected function _resolvePathSpec($paths)
{
$resolved = array();
// Strings treaded as file patterns, but existing file paths treated literally
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $_method is not named in camelCase. Open
protected function _getClassTests(ReflectionClass $class)
{
$methods = array();
foreach ($class->getMethods() as $_method) {
/* @var $_method ReflectionMethod */
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}