chevere/chevere

View on GitHub

Showing 14 of 26 total issues

Method __construct has 35 lines of code (exceeds 25 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 1 hr to fix

    Method withMakeTranslation has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function withMakeTranslation(string $locale, string $domain): self
        {
            $new = clone $this;
            $new->handleLocale($locale);
            $new->localeSourceDir->assertExists();
    Severity: Minor
    Found in src/Translator/TranslatorMaker.php - About 1 hr to fix

      Method breadcrumbObject has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function breadcrumbObject(object $var): void
          {
              $this->breadcrumb = $this->breadcrumb
                  ->withAddedItem('object: ' . $var::class);
              $objectKey = $this->breadcrumb->pos();
      Severity: Minor
      Found in src/VarSupport/VarObject.php - About 1 hr to fix

        Method __construct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function __construct(
                private string $route
            ) {
                $std = new StrictStd();
                $this->data = $std->parse($this->route)[0];
        Severity: Minor
        Found in src/Router/Route/RoutePath.php - About 1 hr to fix

          Method withScanFor has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function withScanFor(DirInterface $sourceDir): self
              {
                  $new = clone $this;
                  $sourceDir->assertExists();
                  $new->sourceDir = $sourceDir;
          Severity: Minor
          Found in src/Translator/PoMaker.php - About 1 hr to fix

            Method streamTemp has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function streamTemp(string $content = ''): StreamInterface
            {
                $stream = 'php://temp';
            
                try {
            Severity: Minor
            Found in src/Writer/functions.php - About 1 hr to fix

              Function runCallableAt has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function runCallableAt(int $pos): void
                  {
                      $callable = $this->benchmark->callables()->get($pos);
                      $name = $this->benchmark->index()->get($pos);
                      for ($i = 0; $i < $this->times; ++$i) {
              Severity: Minor
              Found in src/Benchmark/BenchmarkRun.php - About 55 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

              Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      MessageInterface $message,
                      int $code = 0,
                      int $severity = E_ERROR,
                      string $filename = __FILE__,
                      int $lineno = __LINE__,
              Severity: Minor
              Found in src/Throwable/Exceptions/ErrorException.php - About 45 mins to fix

                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