chevere/chevere

View on GitHub

Showing 26 of 26 total issues

Function withMerge has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function withMerge(DependenciesInterface $dependencies): DependenciesInterface
    {
        $new = clone $this;
        foreach ($dependencies->getIterator() as $name => $className) {
            if ($new->keys->contains($name)) {
Severity: Minor
Found in src/Dependent/Dependencies.php - About 35 mins to fix

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 assertNoConflict has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function assertNoConflict(RouteEndpointInterface $endpoint): void
    {
        if (!isset($this->firstEndpoint)) {
            $this->firstEndpoint = $endpoint;
        } else {
Severity: Minor
Found in src/Router/Route/Route.php - About 35 mins to fix

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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function run(string $anchor, &$argument): void
    {
        $queue = $this->plugsQueue->toArray()[$anchor] ?? [];
        $gettype = $this->getType($argument);
        $type = new Type($gettype);
Severity: Minor
Found in src/Pluggable/Plug/Hook/HooksRunner.php - About 25 mins to fix

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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct(
        private DirInterface $specDir,
        private DirInterface $outputDir,
        private RouterInterface $router
    ) {
Severity: Minor
Found in src/Spec/SpecMaker.php - About 25 mins to fix

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 withDependencies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function withDependencies(object ...$namedDependencies): static
    {
        $new = clone $this;
        $missing = [];
        $new->dependencies ??= $new->getDependencies();
Severity: Minor
Found in src/Dependent/Traits/DependentTrait.php - About 25 mins to fix

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 withAddedEndpoint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function withAddedEndpoint(RouteEndpointInterface $endpoint): RouteInterface
    {
        $new = clone $this;
        $new->assertUnique($endpoint);
        $new->assertNoConflict($endpoint);
Severity: Minor
Found in src/Router/Route/Route.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language