honeybee/honeybee

View on GitHub

Showing 178 of 178 total issues

File FileToolkit.php has 820 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace Honeybee\Common\Util;

use finfo;
Severity: Major
Found in src/Common/Util/FileToolkit.php - About 1 day to fix

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

    <?php
    
    namespace Honeybee\Projection;
    
    use Trellis\Common\Error\RuntimeException;
    Severity: Major
    Found in src/Projection/ReferencedEntityType.php and 1 other location - About 1 day to fix
    src/Model/Aggregate/ReferencedEntityType.php on lines 1..61

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

    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

    <?php
    
    namespace Honeybee\Model\Aggregate;
    
    use Trellis\Common\Error\RuntimeException;
    Severity: Major
    Found in src/Model/Aggregate/ReferencedEntityType.php and 1 other location - About 1 day to fix
    src/Projection/ReferencedEntityType.php on lines 1..60

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

    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

    File AggregateRoot.php has 439 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Honeybee\Model\Aggregate;
    
    use Honeybee\Common\Error\AggregateRoot\AggregateRootError;
    Severity: Minor
    Found in src/Model/Aggregate/AggregateRoot.php - About 6 hrs to fix

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

              foreach ($fixture_files as $fixture_file) {
                  $class_parser = new PhpClassParser;
                  $fixture_class_info = $class_parser->parse((string)$fixture_file);
                  $fixture_class = $fixture_class_info->getFullyQualifiedClassName();
                  $fixture_class_name = $fixture_class_info->getClassName();
      Severity: Major
      Found in src/Infrastructure/Fixture/FileSystemLoader.php and 1 other location - About 5 hrs to fix
      src/Infrastructure/Migration/FileSystemLoader.php on lines 44..71

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

      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

              foreach ($migration_files as $migration_file) {
                  $class_parser = new PhpClassParser;
                  $migration_class_info = $class_parser->parse((string)$migration_file);
                  $migration_class = $migration_class_info->getFullyQualifiedClassName();
                  $migration_class_name = $migration_class_info->getClassName();
      Severity: Major
      Found in src/Infrastructure/Migration/FileSystemLoader.php and 1 other location - About 5 hrs to fix
      src/Infrastructure/Fixture/FileSystemLoader.php on lines 44..71

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

      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 static function getType()
          {
              $fqcn_parts = explode('\\', static::CLASS);
              if (count($fqcn_parts) < 4) {
                  throw new RuntimeError(
      Severity: Major
      Found in src/Infrastructure/Command/Command.php and 1 other location - About 5 hrs to fix
      src/Model/Event/AggregateRootEvent.php on lines 73..93

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

      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 getType()
          {
              $fqcn_parts = explode('\\', static::CLASS);
              if (count($fqcn_parts) < 4) {
                  throw new RuntimeError(
      Severity: Major
      Found in src/Model/Event/AggregateRootEvent.php and 1 other location - About 5 hrs to fix
      src/Infrastructure/Command/Command.php on lines 47..67

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

      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

      File ProjectionUpdater.php has 374 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace Honeybee\Projection\EventHandler;
      
      use Honeybee\Common\Error\RuntimeError;
      Severity: Minor
      Found in src/Projection/EventHandler/ProjectionUpdater.php - About 5 hrs to fix

        Function getEmbeddedCommands has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function getEmbeddedCommands(
                EmbeddedEntityListAttribute $attribute,
                array $values,
                EntityInterface $parent_entity = null
            ) {
        Severity: Minor
        Found in src/Model/Command/EmbeddedEntityCommandBuilder.php - About 4 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

        File CriteriaQueryTranslation.php has 358 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace Honeybee\Infrastructure\DataAccess\Finder\Elasticsearch;
        
        use Assert\Assertion;

          FilesystemService has 29 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class FilesystemService implements FilesystemServiceInterface
          {
              protected $mount_manager;
              protected $schemes;
          
          
          Severity: Minor
          Found in src/Infrastructure/Filesystem/FilesystemService.php - About 3 hrs to fix

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

                            'on_stats' => function (TransferStats $stats) use (&$info, $verbose) {
                                if (!$verbose) {
                                    return;
                                }
                                $info['effective_uri'] = (string)$stats->getEffectiveUri();
            src/Infrastructure/DataAccess/Connector/GuzzleConnector.php on lines 93..108

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

            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

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

                            'on_stats' => function (TransferStats $stats) use (&$info, $verbose) {
                                if (!$verbose) {
                                    return;
                                }
                                $info['effective_uri'] = (string)$stats->getEffectiveUri();
            Severity: Major
            Found in src/Infrastructure/DataAccess/Connector/GuzzleConnector.php and 1 other location - About 3 hrs to fix
            src/Infrastructure/DataAccess/Connector/GuzzleRetryConnector.php on lines 107..122

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

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

                protected function validateValues(array $values)
                {
                    $errors = [];
                    $sanitized_values = [];
            
            
            Severity: Minor
            Found in src/Model/Command/EmbeddedEntityCommandBuilder.php - About 3 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

            Method getEmbeddedCommands has 85 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function getEmbeddedCommands(
                    EmbeddedEntityListAttribute $attribute,
                    array $values,
                    EntityInterface $parent_entity = null
                ) {
            Severity: Major
            Found in src/Model/Command/EmbeddedEntityCommandBuilder.php - About 3 hrs to fix

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

                  protected function setEvent($event_state)
                  {
                      if (is_array($event_state)) {
                          if (!isset($event_state[self::OBJECT_TYPE])) {
                              throw new RuntimeError('Unable to create event without type information.');
              Severity: Major
              Found in src/Infrastructure/Job/Bundle/DistributeEventJob.php and 2 other locations - About 3 hrs to fix
              src/Infrastructure/Job/Bundle/ExecuteCommandJob.php on lines 103..125
              src/Infrastructure/Job/Bundle/ExecuteEventHandlersJob.php on lines 109..132

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

              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

                  protected function setEvent($event_state)
                  {
                      if (is_array($event_state)) {
                          if (!isset($event_state[self::OBJECT_TYPE])) {
                              throw new RuntimeError('Unable to create event without type information.');
              Severity: Major
              Found in src/Infrastructure/Job/Bundle/ExecuteEventHandlersJob.php and 2 other locations - About 3 hrs to fix
              src/Infrastructure/Job/Bundle/DistributeEventJob.php on lines 111..132
              src/Infrastructure/Job/Bundle/ExecuteCommandJob.php on lines 103..125

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

              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

                  protected function setCommand($command_state)
                  {
                      if (is_array($command_state)) {
                          if (!isset($command_state[self::OBJECT_TYPE])) {
                              throw new RuntimeError('Unable to create command without type information.');
              Severity: Major
              Found in src/Infrastructure/Job/Bundle/ExecuteCommandJob.php and 2 other locations - About 3 hrs to fix
              src/Infrastructure/Job/Bundle/DistributeEventJob.php on lines 111..132
              src/Infrastructure/Job/Bundle/ExecuteEventHandlersJob.php on lines 109..132

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

              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 updateMappingsWithReindex has 80 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function updateMappingsWithReindex(MigrationTarget $migration_target)
                  {
                      $client = $this->getConnection($migration_target);
                      $index_api = $client->indices();
                      $index_name = $this->getIndexName($migration_target);
              Severity: Major
              Found in src/Infrastructure/Migration/ElasticsearchMigration.php - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language