honeybee/honeybee

View on GitHub

Showing 178 of 178 total issues

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

    public function loadFixtures()
    {
        $fixture_dir = $this->config->get('directory');
        if (!is_dir($fixture_dir) || !is_readable($fixture_dir)) {
            throw new RuntimeError(sprintf('Given fixture path is not a readable directory: %s', $fixture_dir));
Severity: Minor
Found in src/Infrastructure/Fixture/FileSystemLoader.php - About 1 hr to fix

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

        public function readAll(SettingsInterface $settings = null)
        {
            $settings = $settings ?: new Settings;
    
            if ($settings->get('first', true)) {

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

          protected function mapResultData(array $result_data)
          {
              if ($this->config->get('log_result_data', false) === true) {
                  $this->logger->debug('['.__METHOD__.'] raw result = ' . json_encode($result_data, JSON_PRETTY_PRINT));
              }

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

          protected function updateDesignDoc(MigrationTarget $migration_target)
          {
              $views_directory = $this->getViewsDirectory();
              if (!is_dir($views_directory)) {
                  throw new RuntimeError(sprintf('Given views directory "%s" does not exist.', $views_directory));
      Severity: Minor
      Found in src/Infrastructure/Migration/CouchDbMigration.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 copyFilesToTempLocation has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function copyFilesToTempLocation($folder)
          {
              if (empty($folder) || !is_readable($folder)) {
                  return;
              }
      Severity: Minor
      Found in src/Infrastructure/Fixture/Fixture.php - About 1 hr to fix

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

            protected function guardEventPreConditions(AggregateRootEventInterface $event)
            {
                if (!$event instanceof AggregateRootCreatedEvent
                    && $this->getIdentifier() !== $event->getAggregateRootIdentifier()
                ) {
        Severity: Minor
        Found in src/Model/Aggregate/AggregateRoot.php - About 1 hr to fix

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

              protected function getFreshConnection()
              {
                  $this->needs('user')->needs('password');
          
                  // https://github.com/videlalvaro/php-amqplib/blob/master/PhpAmqpLib/Connection/AMQPStreamConnection.php#L8-L39
          Severity: Minor
          Found in src/Infrastructure/DataAccess/Connector/RabbitMqConnector.php - About 1 hr to fix

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

                public function build()
                {
                    $errors = [];
                    $add_commands = [];
                    $modify_commands = [];
            Severity: Minor
            Found in src/Infrastructure/Command/CommandBuilderList.php - About 1 hr to fix

              Method request has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function request($identifier, $method, array $body = [], array $params = [])
                  {
                      $allowed_methods = [ self::METHOD_GET, self::METHOD_POST, self::METHOD_PUT, self::METHOD_DELETE ];
                      if (!in_array($method, $allowed_methods)) {
                          throw new RuntimeError(
              Severity: Minor
              Found in src/Infrastructure/DataAccess/Storage/CouchDb/CouchDbStorage.php - About 1 hr to fix

                Method getByIdentifier has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getByIdentifier($identifier)
                    {
                        Assertion::string($identifier);
                        Assertion::notBlank($identifier);
                
                

                  Method getByIdentifiers has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getByIdentifiers(array $identifiers)
                      {
                          Assertion::notEmpty($identifiers);
                  
                          $index = $this->getIndex();

                    Method updateChildNodesAfterMovingParent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function updateChildNodesAfterMovingParent(EntityInterface $parent)
                        {
                            // find all existing children of the moved parent node
                            $projection_type = $parent->getType();
                            $parent_identifier = $parent->getIdentifier();
                    Severity: Minor
                    Found in src/Projection/EventHandler/ProjectionUpdater.php - About 1 hr to fix

                      Method translateQueries has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function translateQueries(CriteriaList $criteria_list)
                          {
                              if ($criteria_list->isEmpty()) {
                                  return [ 'match_all' => [] ];
                              } else {

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

                            public function applyEvent(EmbeddedEntityEventInterface $event, $auto_commit = true)
                            {
                                $class_parts = explode('\\', get_class($event));
                                $class_name = array_pop($class_parts);
                                $callback_func = 'on' . preg_replace('~Event$~', '', $class_name);
                        Severity: Minor
                        Found in src/Model/Aggregate/EmbeddedEntity.php - About 1 hr to fix

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

                              public static function generate(ConnectorMap $connector_map)
                              {
                                  $details = [];
                                  $failing = 0;
                                  $working = 0;
                          Severity: Minor
                          Found in src/Infrastructure/DataAccess/Connector/StatusReport.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

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

                              protected function connect()
                              {
                                  $base_uri = $this->config->get('base_uri');
                                  if ($this->config->has('transport') && $this->config->has('host') && $this->config->has('port')) {
                                      $base_uri = sprintf(
                          Severity: Minor
                          Found in src/Infrastructure/DataAccess/Connector/GuzzleConnector.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

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

                              protected function applyEmbeddedEntityEvent(
                                  EmbeddedEntityEventInterface $embedded_entity_event,
                                  $auto_commit = true
                              ) {
                                  $attribute_name = $embedded_entity_event->getParentAttributeName();
                          Severity: Minor
                          Found in src/Model/Aggregate/Entity.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

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

                              public function build()
                              {
                                  $errors = [];
                                  $add_commands = [];
                                  $modify_commands = [];
                          Severity: Minor
                          Found in src/Infrastructure/Command/CommandBuilderList.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

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

                              protected function connect()
                              {
                                  $base_uri = $this->config->get('base_uri');
                                  if ($this->config->has('transport') && $this->config->has('host') && $this->config->has('port')) {
                                      $base_uri = sprintf(
                          Severity: Minor
                          Found in src/Infrastructure/DataAccess/Connector/GuzzleRetryConnector.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

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

                              protected function filterUnmodifiedValues(EntityInterface $entity, array $payload)
                              {
                                  $modified_values = [];
                                  foreach ($entity->getType()->getAttributes() as $attribute_name => $attribute) {
                                      if (!array_key_exists($attribute_name, $payload)) {
                          Severity: Minor
                          Found in src/Model/Command/EmbeddedEntityCommandBuilder.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

                          Severity
                          Category
                          Status
                          Source
                          Language