jeyroik/extas-foundation

View on GitHub

Showing 13 of 13 total issues

Function isQueryApplicableToItem has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    protected function isQueryApplicableToItem(array $query, $item): bool
    {
        $applicable = true;
        foreach ($query as $field => $value) {
            if (str_contains($field, '.')) {
Severity: Minor
Found in src/components/repositories/drivers/DriverFileJson.php - About 2 hrs 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 configure has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function configure()
    {
        $this
            ->setName('install')
            ->setAliases(['i'])
Severity: Minor
Found in src/components/commands/InstallCommand.php - About 1 hr to fix

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

        protected function getCodeForBaseInfo(string $ns, string $tableName, array $tableConfig, array $driverConfig): array
        {
            $this->placeholders = array_merge($this->placeholders, [
                '{namespace}',
                '{uc_table_name}',
    Severity: Minor
    Found in src/components/repositories/RepositoryBuilder.php - About 1 hr to fix

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

          protected function installTable(string $tableName, array $entities): void
          {
              /**
               * @var IRepository $repo
               */
      Severity: Minor
      Found in src/components/installers/InstallerEntities.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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function run(string $appFilename, string $packagesFilename, string $path): array
          {
              $finder = new Finder();
              $finder->name($packagesFilename);
              $extasPackages = [];
      Severity: Minor
      Found in src/components/crawlers/Crawler.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 install has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function install(string $pathSave, string $pathTemplate): void
          {
              $drivers = $this->app[static::FIELD__DRIVERS] ?? [];
      
              if (empty($drivers)) {
      Severity: Minor
      Found in src/components/installers/InstallerStorage.php - About 45 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 installItems has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function installItems(string $tableName, string $itemClass): void
          {
              /**
               * @var IRepository $repo
               */
      Severity: Minor
      Found in src/components/installers/InstallerStorage.php - About 45 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

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

          public function findAll(array $query = [], int $limit = 0, int $offset = 0, array $orderBy = [], array $fields = [])
      Severity: Minor
      Found in src/components/repositories/drivers/DriverFileJson.php - About 35 mins to fix

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

            public function all($where, int $limit = 0, int $offset = 0, array $orderBy = [], array $fields = []);
        Severity: Minor
        Found in src/interfaces/repositories/IRepository.php - About 35 mins to fix

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

                  array $query = [],
                  int $limit = 0,
                  int $offset = 0,
                  array $orderBy = [],
                  array $fields = []
          Severity: Minor
          Found in src/interfaces/repositories/drivers/IDriver.php - About 35 mins to fix

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

                public function findOne(array $query = [], int $offset = 0, array $fields = [])
                {
                    $found = 0;
                    $data = $this->getTableData();
            
            Severity: Minor
            Found in src/components/repositories/drivers/DriverFileJson.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 applyValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function applyValue($entity, $fields): void
                {
                    if (is_object($fields) && method_exists($fields, static::METHOD__TO_ARRAY)) {
                        $fields = $fields->__toArray();
                    }
            Severity: Minor
            Found in src/components/Replace.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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function update($item): bool
                {
                    $pk = $this->getPk();
                    $data = $this->getTableData();
            
            Severity: Minor
            Found in src/components/repositories/drivers/DriverFileJson.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