daikon-cqrs/boot

View on GitHub

Showing 18 of 23 total issues

Function __invoke has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
Open

    public function __invoke(ValidatorDefinition $requestValidatorDefinition)
    {
        $request = $requestValidatorDefinition->getArgument();
        Assertion::isInstanceOf($request, DaikonRequest::class);
        if (!empty($payload = $request->getPayload([]))) {
Severity: Minor
Found in src/Validator/DaikonRequestValidator.php - About 7 hrs 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

DaikonRequest has 41 functions (exceeds 20 allowed). Consider refactoring.
Open

class DaikonRequest implements ServerRequestInterface
{
    public const ERRORS = '_errors';
    public const PAYLOAD = '_payload';
    public const STATUS_CODE = '_status_code';
Severity: Minor
Found in src/Middleware/Action/DaikonRequest.php - About 5 hrs to fix

    Method __invoke has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __invoke(ValidatorDefinition $requestValidatorDefinition)
        {
            $request = $requestValidatorDefinition->getArgument();
            Assertion::isInstanceOf($request, DaikonRequest::class);
            if (!empty($payload = $request->getPayload([]))) {
    Severity: Major
    Found in src/Validator/DaikonRequestValidator.php - About 3 hrs to fix

      Method provision has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function provision(
              Injector $injector,
              ConfigProviderInterface $configProvider,
              ServiceDefinitionInterface $serviceDefinition
          ): void {
      Severity: Major
      Found in src/Service/Provisioner/HttpPipelineProvisioner.php - About 2 hrs to fix

        Function execute has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output): int
            {
                $target = $input->getOption('target');
                $from = intval($input->getOption('from'));
        
        
        Severity: Minor
        Found in src/Console/Command/ImportFixture.php - About 1 hr 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 execute has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output): int
            {
                $target = $input->getOption('target');
                $from = intval($input->getOption('from'));
        
        
        Severity: Minor
        Found in src/Console/Command/ImportFixture.php - About 1 hr to fix

          Function execute has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function execute(InputInterface $input, OutputInterface $output): int
              {
                  $target = $input->getOption('target');
                  $version = intval($input->getOption('to'));
          
          
          Severity: Minor
          Found in src/Console/Command/Migrate/MigrateDown.php - About 1 hr 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 execute has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function execute(InputInterface $input, OutputInterface $output): int
              {
                  if (!count($this->crateMap) || !count($this->migrationTargetMap)) {
                      $output->writeln('<error>There are no targets available to generate migrations for.</error>');
                      $output->writeln('');
          Severity: Minor
          Found in src/Console/Command/Migrate/CreateMigration.php - About 1 hr to fix

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

                private function loadConfiguration(array $bootParams): ConfigProviderInterface
                {
                    $bootParams['daikon'] = ['config_dir' => dirname(dirname(__DIR__)) . '/config'];
                    return new ConfigProvider(
                        new ConfigProviderParams(
            Severity: Minor
            Found in src/Bootstrap/BootstrapTrait.php - About 1 hr to fix

              Function execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function execute(InputInterface $input, OutputInterface $output): int
                  {
                      $target = $input->getOption('target');
                      $version = intval($input->getOption('to'));
              
              
              Severity: Minor
              Found in src/Console/Command/Migrate/MigrateUp.php - About 1 hr 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 execute has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function execute(ActionInterface $action, DaikonRequest $request): ResponseInterface
                  {
                      try {
                          if ($validator = $action->getValidator($request)) {
                              $validatorDefinition = (new ValidatorDefinition('$', Severity::critical()))->withArgument($request);
              Severity: Minor
              Found in src/Middleware/ActionHandler.php - About 1 hr to fix

                Function renderValues has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function renderValues(OutputInterface $output, array $settings, int $indent = 0): void
                    {
                        foreach ($settings as $key => $value) {
                            if (is_scalar($value) || is_null($value)) {
                                switch (true) {
                Severity: Minor
                Found in src/Console/Command/ListConfig.php - About 1 hr 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 buildLazySubscription has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function buildLazySubscription(
                        Injector $injector,
                        string $serviceFqcn,
                        string $subscriptionKey,
                        array $subscriptionConfig,
                Severity: Minor
                Found in src/Service/Provisioner/MessageBusProvisioner.php - About 1 hr to fix

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

                      public function load(array $locations, array $sources): array
                      {
                          $router = $this->router;
                          //these variables are in scope for included routing files
                          $map = $router->getMap();
                  Severity: Minor
                  Found in src/Config/RoutingConfigLoader.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 buildLazySubscription has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          Injector $injector,
                          string $serviceFqcn,
                          string $subscriptionKey,
                          array $subscriptionConfig,
                          TransportMap $transportMap
                  Severity: Minor
                  Found in src/Service/Provisioner/MessageBusProvisioner.php - About 35 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return Factory::createResponse(self::STATUS_INTERNAL_SERVER_ERROR);
                    Severity: Major
                    Found in src/Middleware/RoutingHandler.php - About 30 mins to fix

                      Function provision has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function provision(
                              Injector $injector,
                              ConfigProviderInterface $configProvider,
                              ServiceDefinitionInterface $serviceDefinition
                          ): void {
                      Severity: Minor
                      Found in src/Service/Provisioner/DefaultProvisioner.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 execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function execute(InputInterface $input, OutputInterface $output): int
                          {
                              if (!count($this->crateMap) || !count($this->migrationTargetMap)) {
                                  $output->writeln('<error>There are no targets available to generate migrations for.</error>');
                                  $output->writeln('');
                      Severity: Minor
                      Found in src/Console/Command/Migrate/CreateMigration.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