Showing 662 of 662 total issues
Method getRelationships
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getRelationships($entityClassName, $primaryType)
{
$relationships = new ResourceRelationships;
$metadata = $this->metadataCache->getMapping($entityClassName);
$class = $this->metadataCache->getReflection($entityClassName);
Method getResourceLinks
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getResourceLinks(EntityResource $resource)
{
$links = [];
foreach (
Avoid using undefined variables such as '$data' which will lead to PHP notices. Open
CURLOPT_POSTFIELDS => $data
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$value' which will lead to PHP notices. Open
if (empty($locale) || empty($value)) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$relationships' which will lead to PHP notices. Open
implode('.', $relationships)
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$data' which will lead to PHP notices. Open
$data[$name] = '@'.$filepath;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$locale' which will lead to PHP notices. Open
if (empty($locale) || empty($value)) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$value' which will lead to PHP notices. Open
$translations[$locale][$field] = $value;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$methodToAction' which will lead to PHP notices. Open
$action->name = JsonApiSpec::$methodToAction[$request->getMethod()];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$locale' which will lead to PHP notices. Open
$translations[$locale][$field] = $value;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$locale' which will lead to PHP notices. Open
if (!empty($translations[$locale][$field])) {
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Method parseDeleteAction
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseDeleteAction(Params $params, $relation)
{
$ids = NULL;
if (!empty($params->relationshipIds)) {
Function processLinkedResources
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function processLinkedResources(
ResourceCollectionInterface $resources,
array $include,
LinkedResourcesSerialization $resourcesSerialization,
$depth = 0
- 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 create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create()
{
$include = NULL;
$fields = NULL;
Method parse
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(Request $request, Params $params, array $body)
{
$entity = $params->entities->primary->first();
$ids = NULL;
Function filter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function filter(
QueryBuilder $qb, array $filters, $alias = 'e'
) {
$expressions = [];
- 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 updateTranslations
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function updateTranslations(
ResourceEntityInterface $entity, array $translations
)
{
$repository = $this->em->getRepository(self::TRANSLATION_ENTITY);
- 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 processToManyRelationship
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function processToManyRelationship(
ResourceCollectionInterface $resources,
$relationshipName,
array &$linkedResources,
LinkedResourcesSerialization $resourcesSerialization
- 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 serializeObject
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function serializeObject($object)
{
$json = NULL;
if ($object instanceof \JsonSerializable) {
- 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 mergeTopLevelLinks
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function mergeTopLevelLinks(array &$champion, array $challenger)
{
static $key = 'links';
if (isset($champion[$key]) || isset($challenger[$key])) {
- 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"