Showing 80 of 103 total issues
Method analyze
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function analyze(ElementInterface $element): iterable
{
if (
$element instanceof DocBlockAwareInterface
&& $element->hasDocBlock() === true
Method analyze
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function analyze(ElementInterface $element): iterable
{
if (
(
$element instanceof Method
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
int $complexity,
int $methods,
int $coveredmethods,
int $conditionals,
int $coveredconditionals,
Function enrich
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function enrich(DataAwareInterface $dataHolder): void
{
if ($dataHolder instanceof Interface_) {
$implementedBy = [];
$project = $dataHolder->getProject();
- 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 walk
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function walk(iterable $elements): iterable
{
foreach ($elements as $element) {
if ($element instanceof ElementInterface) {
yield $element;
- 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 getArguments
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getArguments(): array
{
if (isset($this->arguments) === false) {
$this->arguments = [];
if ($this->php !== null) {
- 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 outputError
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function outputError(ErrorEvent $event): void
{
$exception = $event->getThrowable();
$this->style->error(
[
- 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 analyze
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function analyze(ElementInterface $element): iterable
{
if (
$element instanceof VisibilityAwareInterface
&& $element instanceof DocBlockAwareInterface
Method analyze
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function analyze(ElementInterface $element): iterable
{
if (
$element instanceof DocBlockAwareInterface
&& $element->hasDocBlock() === true
Method outputIssues
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function outputIssues(string $elementId, array $issues): void
{
$verbosity = $this->style->getVerbosity();
/** @var \Klitsche\Dog\Analyzer\Issue[] $filteredIssues */
Method analyze
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function analyze(ElementInterface $element): iterable
{
if (
$element instanceof DocBlockAwareInterface
&& $element->hasDocBlock() === true
Method analyze
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function analyze(ElementInterface $element): iterable
{
if (
$element instanceof DocBlockAwareInterface
&& $element->hasDocBlock() === true
Method renderFile
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function renderFile($template, $fileName, $context): void
{
$this->currentFileName = $fileName;
$this->emitProgress(PrinterInterface::PROGRESS_TOPIC, 1, $fileName);
Consider simplifying this complex logical expression. Open
if (
(
$element->getReturnType() === null
&& $element->getName() !== '__construct'
&& $element->getName() !== '__destruct'
Function getProperties
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getProperties(): array
{
if (isset($this->properties) === false) {
$this->properties = [];
foreach ($this->php->getProperties() as $property) {
- 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 enrich
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function enrich(DataAwareInterface $dataHolder): void
{
switch (true) {
case $dataHolder instanceof ProjectInterface:
$elements = $this->clover->xpath('//project');
- 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 getMethods
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getMethods(): array
{
if (isset($this->methods) === false) {
$this->methods = [];
foreach ($this->php->getMethods() as $method) {
- 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 matches
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function matches(ElementInterface $element): bool
{
foreach ($this->match as $method => $expectedResult) {
if (method_exists($element, $method) === false) {
return false;
- 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 getReturnType
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getReturnType(): ?Type
{
if ($this->getDocBlock() && $this->getDocBlock()->hasTag('return')) {
/** @var DocBlock\Tags\Return_ $tag */
$tag = $this->getDocBlock()->getTagsByName('return')[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
Function validateFunction
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function validateFunction(ElementInterface $element): iterable
{
foreach ($element->getArguments() as $i => $argument) {
if (
$argument->getType() === null
- 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"