honeybee/honeybee

View on GitHub

Showing 178 of 178 total issues

Function read has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function read($identifier, SettingsInterface $settings = null)
    {
        try {
            $view_params = [
                'startkey' => sprintf(self::STARTKEY_FILTER, $identifier),

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

    protected function tryToReadMetadata()
    {
        $serialized_metadata = fgets($this->file_pointer);
        if (!$serialized_metadata) {
            return new BulkStreamError(
Severity: Minor
Found in src/Model/Command/Bulk/BulkStreamIterator.php - About 35 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 tryToExecute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function tryToExecute(CommandInterface $command, $retry_count = 0)
    {
        $aggregate_root = $this->checkoutOrCreateAggregateRoot($command);
        $this->doExecute($command, $aggregate_root);
        $comitted_events = $this->getUnitOfWork()->commit()->filter(function (AggregateRootEventList $event_list) {
Severity: Minor
Found in src/Model/Command/AggregateRootCommandHandler.php - About 35 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 getByIdentifier has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

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

Avoid too many return statements within this method.
Open

            return Status::failing($this, [ 'message' => 'Error on "' . $path . '": ' . $e->getMessage() ]);
Severity: Major
Found in src/Infrastructure/DataAccess/Connector/GuzzleConnector.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return (string)$arg;
    Severity: Major
    Found in src/Infrastructure/Workflow/WorkflowService.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return Status::failing(
                      $this,
                      [
                          'message' => 'GET failed: ' . $path,
                          'headers' => $response->getHeaders(),
      Severity: Major
      Found in src/Infrastructure/DataAccess/Connector/GuzzleRetryConnector.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

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

          Avoid too many return statements within this method.
          Open

                      return Status::failing(
                          $this,
                          [
                              'message' => 'GET failed: ' . $path,
                              'headers' => $response->getHeaders(),
          Severity: Major
          Found in src/Infrastructure/DataAccess/Connector/GuzzleConnector.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return Status::failing($this, [ 'message' => 'Error on "' . $test . '": ' . $e->getMessage() ]);
            Severity: Major
            Found in src/Infrastructure/DataAccess/Connector/ElasticsearchConnector.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return (string)$var;
              Severity: Major
              Found in src/Common/Util/StringToolkit.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return null;
                Severity: Major
                Found in src/Infrastructure/Migration/MigrationService.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $projection_type->createEntity($mirrored_values, $projection->getParent());
                  Severity: Major
                  Found in src/Projection/EventHandler/ProjectionUpdater.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                            return Status::working($this, [ 'message' => 'Pinging elasticsearch succeeded.' ]);
                    Severity: Major
                    Found in src/Infrastructure/DataAccess/Connector/ElasticsearchConnector.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return json_encode($obj);
                      Severity: Major
                      Found in src/Common/Util/StringToolkit.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return Status::failing($this, [ 'message' => 'Error on "' . $path . '": ' . $e->getMessage() ]);
                        Severity: Major
                        Found in src/Infrastructure/DataAccess/Connector/GuzzleRetryConnector.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return Status::failing(
                                          $this,
                                          [ 'message' => 'Exception on file path existance check: ' . $e->getMessage() ]
                                      );

                            Avoid too many return statements within this method.
                            Open

                                                return Status::working($this, $this->getConnection()->nodes()->stats());
                            Severity: Major
                            Found in src/Infrastructure/DataAccess/Connector/ElasticsearchConnector.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                                  return Status::failing($this, [ 'message' => 'Pinging elasticsearch failed.' ]);
                              Severity: Major
                              Found in src/Infrastructure/DataAccess/Connector/ElasticsearchConnector.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return 'true';
                                Severity: Major
                                Found in src/Common/Util/StringToolkit.php - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language