honeybee/honeybee

View on GitHub

Showing 178 of 178 total issues

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

    public function createJob(array $job_state)
    {
        if (!isset($job_state['metadata']['job_name']) || empty($job_state['metadata']['job_name'])) {
            throw new RuntimeError('Unable to get job name from metadata.');
        }
Severity: Minor
Found in src/Infrastructure/Job/JobService.php - About 1 hr to fix

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

        public function readAll(SettingsInterface $settings = null)
        {
            $settings = $settings ?: new Settings;
    
            $data = [];

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

          public function readAll(SettingsInterface $settings = null)
          {
              $settings = $settings ?: new Settings;
      
              $data = [];

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

            public function readAll(SettingsInterface $settings = null)
            {
                $settings = $settings ?: new Settings;
        
                $data = [];

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

              protected function createExchangePipeline(MigrationTargetInterface $migration_target, $exchange_name)
              {
                  Assertion::string($exchange_name);
          
                  $wait_exchange_name = $exchange_name . self::WAIT_SUFFIX;
          Severity: Minor
          Found in src/Infrastructure/Migration/RabbitMqMigration.php - About 1 hr to fix

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

                protected function onProjectionUpdated(ProjectionUpdatedEvent $event)
                {
                    $reference_filter = $this->getReferenceFilter($event);
                    if ($reference_filter->isEmpty()) {
                        // type doesn't seem to be referenced anywhere => nothing to do
            Severity: Minor
            Found in src/Projection/EventHandler/RelationProjectionUpdater.php - About 1 hr to fix

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

                  protected function setEmbeddedEntityEvents($embedded_entity_events)
                  {
                      if ($embedded_entity_events instanceof EmbeddedEntityEventList) {
                          $this->embedded_entity_events = $embedded_entity_events;
                      } elseif (is_array($embedded_entity_events)) {
              Severity: Major
              Found in src/Model/Event/EmbeddedEntityEvent.php and 3 other locations - About 1 hr to fix
              src/Model/Command/AggregateRootTypeCommand.php on lines 32..45
              src/Model/Command/EmbeddedEntityTypeCommand.php on lines 39..52
              src/Model/Event/AggregateRootEvent.php on lines 47..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 101.

              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 4 locations. Consider refactoring.
              Open

                  protected function setEmbeddedEntityEvents($embedded_entity_events)
                  {
                      if ($embedded_entity_events instanceof EmbeddedEntityEventList) {
                          $this->embedded_entity_events = $embedded_entity_events;
                      } elseif (is_array($embedded_entity_events)) {
              Severity: Major
              Found in src/Model/Event/AggregateRootEvent.php and 3 other locations - About 1 hr to fix
              src/Model/Command/AggregateRootTypeCommand.php on lines 32..45
              src/Model/Command/EmbeddedEntityTypeCommand.php on lines 39..52
              src/Model/Event/EmbeddedEntityEvent.php on lines 55..68

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

              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 4 locations. Consider refactoring.
              Open

                  protected function setEmbeddedEntityCommands($embedded_entity_commands)
                  {
                      if ($embedded_entity_commands instanceof EmbeddedEntityTypeCommandList) {
                          $this->embedded_entity_commands = $embedded_entity_commands;
                      } elseif (is_array($embedded_entity_commands)) {
              Severity: Major
              Found in src/Model/Command/EmbeddedEntityTypeCommand.php and 3 other locations - About 1 hr to fix
              src/Model/Command/AggregateRootTypeCommand.php on lines 32..45
              src/Model/Event/AggregateRootEvent.php on lines 47..60
              src/Model/Event/EmbeddedEntityEvent.php on lines 55..68

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

              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 4 locations. Consider refactoring.
              Open

                  protected function setEmbeddedEntityCommands($embedded_entity_commands)
                  {
                      if ($embedded_entity_commands instanceof EmbeddedEntityTypeCommandList) {
                          $this->embedded_entity_commands = $embedded_entity_commands;
                      } elseif (is_array($embedded_entity_commands)) {
              Severity: Major
              Found in src/Model/Command/AggregateRootTypeCommand.php and 3 other locations - About 1 hr to fix
              src/Model/Command/EmbeddedEntityTypeCommand.php on lines 39..52
              src/Model/Event/AggregateRootEvent.php on lines 47..60
              src/Model/Event/EmbeddedEntityEvent.php on lines 55..68

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

              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

                      if ($this->config->has('auth')) {
                          $auth = (array)$this->config->get('auth');
                          if (!empty($auth['username']) && !empty($auth['password'])) {
                              $client_options['auth'] = [
                                  $auth['username'],
              Severity: Minor
              Found in src/Infrastructure/DataAccess/Connector/GuzzleConnector.php and 1 other location - About 1 hr to fix
              src/Infrastructure/DataAccess/Connector/GuzzleRetryConnector.php on lines 46..55

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

              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

                      if ($this->config->has('auth')) {
                          $auth = (array)$this->config->get('auth');
                          if (!empty($auth['username']) && !empty($auth['password'])) {
                              $client_options['auth'] = [
                                  $auth['username'],
              src/Infrastructure/DataAccess/Connector/GuzzleConnector.php on lines 36..45

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

              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\Task\ProceedWorkflow;
              
              use Honeybee\Common\Error\RuntimeError;
              src/Model/Task/CreateAggregateRoot/CreateAggregateRootCommandHandler.php on lines 1..28

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

              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\Task\CreateAggregateRoot;
              
              use Honeybee\Common\Error\RuntimeError;
              src/Model/Task/ProceedWorkflow/ProceedWorkflowCommandHandler.php on lines 1..28

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

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

                  public function resolveStateMachineName($arg)
                  {
                      if (is_string($arg) && empty(trim($arg))) {
                          throw new RuntimeError('State machine name must be a non-empty string.');
                      }
              Severity: Minor
              Found in src/Infrastructure/Workflow/WorkflowService.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

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

                  public function getFileHandlingAttributes()
                  {
                      $attributes = [];
              
                      foreach ($this->getAttributes() as $attribute_name => $attribute) {
              Severity: Minor
              Found in src/EntityType.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

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

                  public function conflictsWith(AggregateRootEventInterface $event, array &$conflicting_changes = [])
                  {
                      if ($event->getAggregateRootIdentifier() !== $this->getAggregateRootIdentifier()) {
                          return false;
                      }
              Severity: Minor
              Found in src/Model/Task/ModifyAggregateRoot/ModifyAggregateRootCommand.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

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

              <?php
              
              namespace Honeybee\Infrastructure\DataAccess\Query;
              
              use Trellis\Common\BaseObject;
              Severity: Minor
              Found in src/Infrastructure/DataAccess/Query/SpatialCriteria.php and 1 other location - About 55 mins to fix
              src/Infrastructure/DataAccess/Query/AttributeCriteria.php on lines 1..37

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

              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\Infrastructure\DataAccess\Query;
              
              use Trellis\Common\BaseObject;
              Severity: Minor
              Found in src/Infrastructure/DataAccess/Query/AttributeCriteria.php and 1 other location - About 55 mins to fix
              src/Infrastructure/DataAccess/Query/SpatialCriteria.php on lines 1..37

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

              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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function __construct($message, $type, $identifier, $revision, $code = 0, Exception $previous = null)
              Severity: Minor
              Found in src/Common/Error/AggregateRoot/CommandRevisionError.php - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language