gerencianet/gn-api-sdk-php

View on GitHub
migrationChecker.php

Summary

Maintainability
D
2 days
Test Coverage

File migrationChecker.php has 542 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Certifique-se de inserir este arquivo na raiz do seu projeto, para que possa validar todos os arquivos
 * e de inserir corretamente o caminho para os arquivos do autoload do Composer na linha 55.
Severity: Major
Found in migrationChecker.php - About 1 day to fix

    Function getMissingPackages has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        private function getMissingPackages(): array
        {
            $missingPackages = [];
    
            foreach (self::REQUIRED_PACKAGES as $package => $version) {
    Severity: Minor
    Found in migrationChecker.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

    Function getCorrections has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        private function getCorrections(): array
        {
            $corrections = [];
    
            foreach ($this->getPhpFiles() as $filePath) {
    Severity: Minor
    Found in migrationChecker.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 getCorrections has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function getCorrections(): array
        {
            $corrections = [];
    
            foreach ($this->getPhpFiles() as $filePath) {
    Severity: Minor
    Found in migrationChecker.php - About 1 hr to fix

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

          public function checkSDKInstallation(): array
          {
              $resultSdkInfo = [];
              foreach ($this->installedPackages['packages'] as $package) {
                  if ($package['name'] === 'efipay/sdk-php-apis-efi' || $package['name'] === 'gerencianet/gerencianet-sdk-php') {
      Severity: Minor
      Found in migrationChecker.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

      There are no issues that match your filters.

      Category
      Status