daikon-cqrs/boot

View on GitHub

Showing 23 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

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        private function delegateLoaderMap(Injector $injector, array $loaderConfigs): void
        {
            $factory = function (ConnectorMap $connectorMap) use (
                $injector,
                $loaderConfigs
    Severity: Major
    Found in src/Service/Provisioner/MigrationTargetMapProvisioner.php and 2 other locations - About 4 hrs to fix
    src/Service/Provisioner/FixtureTargetMapProvisioner.php on lines 34..57
    src/Service/Provisioner/MigrationTargetMapProvisioner.php on lines 60..78

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 166.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        private function delegateLoaderMap(Injector $injector, array $loaderConfigs): void
        {
            $factory = function (ConnectorMap $connectorMap) use (
                $injector,
                $loaderConfigs
    Severity: Major
    Found in src/Service/Provisioner/FixtureTargetMapProvisioner.php and 2 other locations - About 4 hrs to fix
    src/Service/Provisioner/MigrationTargetMapProvisioner.php on lines 37..58
    src/Service/Provisioner/MigrationTargetMapProvisioner.php on lines 60..78

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 166.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

        private function delegateAdapterMap(Injector $injector, array $adapterConfigs): void
        {
            $factory = function (ConnectorMap $connectorMap) use ($injector, $adapterConfigs): MigrationAdapterMap {
                $adapters = [];
                foreach ($adapterConfigs as $adapterKey => $adapterConfig) {
    Severity: Major
    Found in src/Service/Provisioner/MigrationTargetMapProvisioner.php and 2 other locations - About 4 hrs to fix
    src/Service/Provisioner/FixtureTargetMapProvisioner.php on lines 34..57
    src/Service/Provisioner/MigrationTargetMapProvisioner.php on lines 37..58

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 166.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            public function provision(
                Injector $injector,
                ConfigProviderInterface $configProvider,
                ServiceDefinitionInterface $serviceDefinition
            ): void {
        Severity: Major
        Found in src/Service/Provisioner/MigrationTargetMapProvisioner.php and 1 other location - About 1 hr to fix
        src/Service/Provisioner/JobDefinitionMapProvisioner.php on lines 22..34

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 118.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            public function provision(
                Injector $injector,
                ConfigProviderInterface $configProvider,
                ServiceDefinitionInterface $serviceDefinition
            ): void {
        Severity: Major
        Found in src/Service/Provisioner/JobDefinitionMapProvisioner.php and 1 other location - About 1 hr to fix
        src/Service/Provisioner/MigrationTargetMapProvisioner.php on lines 23..35

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 118.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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 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

            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

              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
                    Severity
                    Category
                    Status
                    Source
                    Language