Showing 125 of 125 total issues
Multi-line function declarations must define one parameter per line Open
RamlDoc $ramlDoc, array $item, $itemKey = NULL
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
return FALSE;
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
$callback = function($part) { return '/' . $part; };
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "false" but found "FALSE" Open
return FALSE;
- Exclude checks
Function dereferenceIncludes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function dereferenceIncludes(array &$map, $fileDir = __DIR__)
{
foreach ($map as &$value) {
if (is_string($value)) {
if (RamlDoc::isInclude($value)) {
- 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
Each PHP statement must be on a line by itself Open
$callback = function($param) { return '<<' . $param . '>>'; };
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" Open
$this->usage = !empty($source['usage']) ? $source['usage'] : NULL;
- Exclude checks
Multi-line function declarations must define one parameter per line Open
$method, $resourceUri, $mediaType = RamlSpec::MEDIA_TYPE_JSON
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
{
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "true" but found "TRUE" Open
if ($key === $name) return TRUE;
- Exclude checks
Each PHP statement must be on a line by itself Open
$callback = function($param) { return '<<' . $param . '>>'; };
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" Open
$this->usage = !empty($source['usage']) ? $source['usage'] : NULL;
- Exclude checks
Missing class import via use statement (line '40', column '23'). Open
throw new \ErrorException(
- 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
Missing class import via use statement (line '65', column '31'). Open
throw new \ErrorException($message);
- 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
Missing class import via use statement (line '58', column '27'). Open
throw new \ErrorException(self::ERROR_ROOT_SCHEMA_VALUE);
- 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
Missing class import via use statement (line '97', column '31'). Open
throw new \ErrorException(
- 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
Missing class import via use statement (line '32', column '23'). Open
throw new \ErrorException(
- 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
Missing class import via use statement (line '65', column '23'). Open
throw new \UnexpectedValueException($mediaType);
- 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
Missing class import via use statement (line '128', column '27'). Open
throw new \ErrorException(self::ERROR_INVALID_KEY);
- 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
Missing class import via use statement (line '120', column '27'). Open
throw new \ErrorException($message);
- 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();
}