FriendsOfPHP/pickle

View on GitHub

Showing 59 of 59 total issues

Method configure has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function configure()
    {
        parent::configure();

        $this
Severity: Minor
Found in src/Console/Command/ReleaseCommand.php - About 1 hr to fix

    Method prepare has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function prepare()
        {
            $matches = null;
            if (Type::determinePickle($this->path, $matches) < 1) {
                throw new Exception('Not a pickle git URI');
    Severity: Minor
    Found in src/Package/Convey/Command/Pickle.php - About 1 hr to fix

      Function rebuildPickleParts has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function rebuildPickleParts($pickleSection, array $dlls_add, array $dlls_del = [])
          {
              $lines = explode("\n", $pickleSection);
              $new = [];
      
      
      Severity: Minor
      Found in src/Engine/PHP/Ini.php - About 1 hr 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 appendPkgConfigureOptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function appendPkgConfigureOptions(&$configureOptions)
          {
              $opt = $this->pkg->getConfigureOptions();
              if (isset($opt[$this->pkg->getName()])) {
                  $extEnableOption = $opt[$this->pkg->getName()];
      Severity: Minor
      Found in src/Base/Abstracts/Package/Build.php - About 1 hr 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 getInfoFromConfigureLog has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getInfoFromConfigureLog()
          {
              $info = [
                  'thread_safe' => null,
                  'compiler' => null,
      Severity: Minor
      Found in src/Package/PHP/Command/Build/Windows.php - About 1 hr to fix

        Method download has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function download($url)
            {
                $output = $this->output;
                $progress = $this->progress;
        
        
        Severity: Minor
        Found in src/Package/Util/Windows/DependencyLib.php - About 1 hr to fix

          Function copyFiles has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              private function copyFiles()
              {
                  $DLLs = glob($this->tempDir . '/*.dll');
                  $this->extDll = [];
                  foreach ($DLLs as $dll) {
          Severity: Minor
          Found in src/Package/PHP/Command/Install/Windows/Binary.php - About 1 hr 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 findInLinks has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function findInLinks($url, $toFind)
              {
                  $page = @file_get_contents($url);
                  $opts = [
                      'http' => [
          Severity: Minor
          Found in src/Package/PHP/Command/Install/Windows/Binary.php - About 1 hr to fix

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

                public function __construct(Interfaces\Package $package)
                {
                    $dir = $package->getSourceDir();
                    $path = $package->getSourceDir() . '/.gitignore';
                    $this->excluded = glob("{$dir}/.git/*");
            Severity: Minor
            Found in src/Base/Util/GitIgnore.php - About 1 hr to fix

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

                  protected function fetchArg($which, $config)
                  {
                      $next = 0;
                      $options = [];
              
              
              Severity: Minor
              Found in src/Package/PHP/Package.php - About 1 hr to fix

                Method getInfoFromPecl has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function getInfoFromPecl()
                    {
                        $baseUrl = WebsiteFactory::getWebsite()->getBaseUrl();
                        $url = $baseUrl . '/get/' . $this->extName;
                        $headers = get_headers($url);
                Severity: Minor
                Found in src/Package/PHP/Command/Install/Windows/Binary.php - About 1 hr to fix

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

                      public function getConfigureOptions()
                      {
                          $options = [];
                  
                          if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
                  Severity: Minor
                  Found in src/Package/PHP/Package.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 getInfoFromPecl has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function getInfoFromPecl()
                      {
                          $baseUrl = WebsiteFactory::getWebsite()->getBaseUrl();
                          $url = $baseUrl . '/get/' . $this->extName;
                          $headers = get_headers($url);
                  Severity: Minor
                  Found in src/Package/PHP/Command/Install/Windows/Binary.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 getIniPathFromPhpInfo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function getIniPathFromPhpInfo($info)
                      {
                          $iniPath = '';
                  
                          foreach ($info as $s) {
                  Severity: Minor
                  Found in src/Engine/PHP.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 findInLinks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function findInLinks($url, $toFind)
                      {
                          $page = @file_get_contents($url);
                          $opts = [
                              'http' => [
                  Severity: Minor
                  Found in src/Package/PHP/Command/Install/Windows/Binary.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 prepare has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function prepare()
                      {
                          $engine = Engine::factory();
                          $matches = null;
                          if (Type::determinePecl($this->path, $matches) < 1) {
                  Severity: Minor
                  Found in src/Package/PHP/Convey/Command/Pecl.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 sourceInstall has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      protected function sourceInstall($package, InputInterface $input, OutputInterface $output, $optionsValue = [], $force_opts = ''): bool
                  Severity: Minor
                  Found in src/Console/Command/InstallerCommand.php - About 35 mins to fix

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

                        private function create(string $path, bool $overwrite): void
                        {
                            $flags = ZipArchive::CREATE;
                            if ($overwrite === false) {
                                if (file_exists($path)) {
                    Severity: Minor
                    Found in src/Base/Archive/PHPZipper.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 fetchDllMap has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function fetchDllMap()
                        {
                            $dllMap = null;
                    
                            if ($this->dllMap === null) {
                    Severity: Minor
                    Found in src/Package/Util/Windows/DependencyLib.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 readPackage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function readPackage($path, $noconvert)
                        {
                            $jsonLoader = new Package\Util\JSON\Loader(new Package\Util\Loader());
                            $package = null;
                    
                    
                    Severity: Minor
                    Found in src/Package/PHP/Util/PackageJson.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

                    Severity
                    Category
                    Status
                    Source
                    Language