honeybee/honeybee

View on GitHub

Showing 178 of 178 total issues

Avoid too many return statements within this method.
Open

            return 'null';
Severity: Major
Found in src/Common/Util/StringToolkit.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return new BulkMetadata($metadata['_type'], $metadata['_identifier'], $metadata['_command']);
    Severity: Major
    Found in src/Model/Command/Bulk/BulkStreamIterator.php - About 30 mins to fix

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

          public function getScopeKey()
          {
              $parent_attribute = $this->getType()->getParentAttribute();
              $scope_key_pieces = [];
      
      
      Severity: Minor
      Found in src/Entity.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 readAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

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

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

          protected function handleEmbeddedEntityEvents(EntityInterface $projection, EmbeddedEntityEventList $events)
          {
              foreach ($events as $event) {
                  if ($event instanceof EmbeddedEntityAddedEvent) {
                      $this->onEmbeddedEntityAdded($projection, $event);
      Severity: Minor
      Found in src/Projection/EventHandler/ProjectionUpdater.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 processEmbeddedEntityCommand has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function processEmbeddedEntityCommand(CommandInterface $command, array $custom_event_state = [])
          {
              $event_class = $command->getEventClass();
              $attribute_name = $command->getParentAttributeName();
      
      
      Severity: Minor
      Found in src/Model/Aggregate/AggregateRoot.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 readAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

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

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

          protected function mapResultData(array $result_data)
          {
              $results = [];
              $hits = $result_data['hits'];
              foreach ($hits['hits'] as $hit) {

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

          protected function getIndexSettings(MigrationTarget $migration_target, $include_type_mapping = false)
          {
              $settings_json_file = $this->getIndexSettingsPath($migration_target);
      
              if (empty($settings_json_file)) {
      Severity: Minor
      Found in src/Infrastructure/Migration/ElasticsearchMigration.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 excludeAttributes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function excludeAttributes(array &$array)
          {
              foreach (self::$excluded_attributes as $excluded_attribute) {
                  if (array_key_exists($excluded_attribute, $array)) {
                      unset($array[$excluded_attribute]);
      Severity: Minor
      Found in src/Infrastructure/Fixture/FixtureService.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 readAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

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

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

          protected function moveTempFileToFinalLocation($location, EntityTypeInterface $art)
          {
              $from_uri = $this->filesystem_service->createTempUri($location, $art); // from temporary storage
              $to_uri = $this->filesystem_service->createUri($location, $art); // to final storage
      
      
      Severity: Minor
      Found in src/Projection/EventHandler/ProjectionFileHandler.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 getDirection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function getDirection($target_name, $target_version = null)
          {
              $migration_target = $this->getMigrationTarget($target_name);
              $latest_structure_version = $migration_target->getLatestStructureVersion();
      
      
      Severity: Minor
      Found in src/Infrastructure/Migration/MigrationService.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 updateAffectedRelatives has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function updateAffectedRelatives(
              ProjectionMap $affected_relatives_map,
              ProjectionInterface $source_projection
          ) {
              $referenced_identifier = $source_projection->getIdentifier();
      Severity: Minor
      Found in src/Projection/EventHandler/RelationProjectionUpdater.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 onEmbeddedEntityModified has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function onEmbeddedEntityModified(EntityInterface $projection, EmbeddedEntityModifiedEvent $event)
          {
              $embedded_projection_attr = $projection->getType()->getAttribute($event->getParentAttributeName());
              $embedded_projection_type = $this->getEmbeddedEntityType($projection, $event);
      
      
      Severity: Minor
      Found in src/Projection/EventHandler/ProjectionUpdater.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 sanitizeAttributeValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function sanitizeAttributeValue(AttributeInterface $attribute, $value)
          {
              $errors = [];
              $sanitized_value = null;
      
      
      Severity: Minor
      Found in src/Model/Command/EmbeddedEntityCommandBuilder.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 filterEmptyValues has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function filterEmptyValues(array $array, callable $callback = null, $recursive = true)
          {
              $filtered = [];
      
              foreach ($array as $prop => $value) {
      Severity: Minor
      Found in src/Common/Util/ArrayToolkit.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 mirrorReferencedProjection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function mirrorReferencedProjection(EntityReferenceInterface $projection)
          {
              $projection_type = $projection->getType();
              $mirrored_attribute_map = $projection_type->getAttributes()->filter(
                  function (AttributeInterface $attribute) {
      Severity: Minor
      Found in src/Projection/EventHandler/ProjectionUpdater.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