Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-indices/Model/IndexStatusProvider.php

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 9 of 9 total issues

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

ClientInterface $client,
IndexSettingsHelper $indexSettingsHelper,
StoreIndicesCollectionFactory $storeIndicesFactory,
WorkingIndexerCollectionFactory $indexerCollectionFactory,
LoggerInterface $logger
Severity: Minor
Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 35 mins to fix

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

    private function isRebuilding(string $indexName, $indexDate): bool
    {
    if ($indexDate === false) {
    // If $indexDate is false, we cannot rebuild.
    return false;
    Severity: Minor
    Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 35 mins to fix

    Avoid too many return statements within this method.
    Open

    return false;
    Severity: Minor
    Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

      return false;
      Severity: Minor
      Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

        return IndexStatus::UNDEFINED_STATUS;
        Severity: Major
        Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

          return IndexStatus::GHOST_STATUS;
          Severity: Major
          Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

            return IndexStatus::REBUILDING_STATUS;
            Severity: Minor
            Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

              return true;
              Severity: Minor
              Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                return IndexStatus::LIVE_STATUS;
                Severity: Minor
                Found in src/module-elasticsuite-indices/Model/IndexStatusProvider.php - About 30 mins to fix

                  There are no issues that match your filters.

                  Category
                  Status