Showing 758 of 758 total issues
Function results
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function results(Tree $tree, int $depth): GeoAnalysisResults
{
$results = new GeoAnalysisResults();
foreach ($this->geoanalysis_data_service->individualsAndFamilies($tree) as $record) {
- 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 significantPlaces
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function significantPlaces(Individual $individual): Generator
{
yield $individual->getBirthPlace();
/** @var \Fisharebest\Webtrees\Fact $fact */
- 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
Avoid too many return
statements within this method. Open
return $target_format;
Avoid too many return
statements within this method. Open
return $indi;
The method sortedKnownPlaces has a boolean flag argument $exclude_other, which is a certain sign of a Single Responsibility Principle violation. Open
public function sortedKnownPlaces(bool $exclude_other = false): Collection
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method with has a boolean flag argument $use_flags, which is a certain sign of a Single Responsibility Principle violation. Open
bool $use_flags = false
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method knownPlaces has a boolean flag argument $exclude_other, which is a certain sign of a Single Responsibility Principle violation. Open
public function knownPlaces(bool $exclude_other = false): Collection
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid too many return
statements within this method. Open
return $this->replacementImageResponse((string) StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR)
->withHeader('X-Image-Exception', $ex->getMessage());
The method all has a boolean flag argument $include_disabled, which is a certain sign of a Single Responsibility Principle violation. Open
public function all(bool $include_disabled = false): Collection
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method find has a boolean flag argument $include_disabled, which is a certain sign of a Single Responsibility Principle violation. Open
public function find(Tree $tree, int $id, bool $include_disabled = false): ?AbstractGeoAnalysisView
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid too many return
statements within this method. Open
return I18N::translate('%s not precise', $context_label);
The method certificateFileResponse has a boolean flag argument $add_watermark, which is a certain sign of a Single Responsibility Principle violation. Open
bool $add_watermark = false,
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method exclude has a boolean flag argument $exclude, which is a certain sign of a Single Responsibility Principle violation. Open
public function exclude(bool $exclude = true): self
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method find has a boolean flag argument $include_disabled, which is a certain sign of a Single Responsibility Principle violation. Open
public function find(string $hook_name, bool $include_disabled = false): ?HookCollectorInterface
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method all has a boolean flag argument $include_disabled, which is a certain sign of a Single Responsibility Principle violation. Open
public function all(bool $include_disabled = false): Collection
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method all has a boolean flag argument $include_disabled, which is a certain sign of a Single Responsibility Principle violation. Open
public function all(bool $include_disabled = false): Collection
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method run has a boolean flag argument $force, which is a certain sign of a Single Responsibility Principle violation. Open
public function run(TaskSchedule $task_schedule, $force = false): void
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method all has a boolean flag argument $sync_available, which is a certain sign of a Single Responsibility Principle violation. Open
public function all(bool $sync_available = false, bool $include_disabled = true): Collection
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid too many return
statements within this method. Open
return I18N::translate('%s not found', $context_label);
The method allForView has a boolean flag argument $show_invalid, which is a certain sign of a Single Responsibility Principle violation. Open
public function allForView(GeoAnalysisMap $map_view, bool $show_invalid = false): Collection
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}