serp-spider/core

View on GitHub

Showing 48 of 48 total issues

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

    private function parseInput(\DOMElement $input, array $formData, array &$consumed)
    {
        $name = strtolower($input->getAttribute('name'));

        if (!$name) {
Severity: Minor
Found in src/Core/Dom/WebPage.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 createFromString has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function createFromString($proxy)
    {

        if (preg_match('#^[a-zA-Z0-9]+://#', $proxy)) {
            list($type, $proxy) = explode('://', $proxy, 2);
Severity: Minor
Found in src/Core/Http/Proxy.php - About 1 hr to fix

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

        public function cloneAs($as = null)
        {
    
            if (null === $as) {
                $as = static::class;
    Severity: Minor
    Found in src/Core/Url/UrlArchiveTrait.php - About 1 hr to fix

      Method initWithDefaults has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $scheme = null,
              $host = null,
              $path = null,
              array $query = [],
              $hash = null,
      Severity: Major
      Found in src/Core/Url/UrlArchiveTrait.php - About 1 hr to fix

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

                $scheme = null,
                $host = null,
                $path = null,
                array $query = [],
                $hash = null,
        Severity: Major
        Found in src/Core/UrlArchive.php - About 1 hr to fix

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

                  $scheme = null,
                  $host = null,
                  $path = null,
                  array $query = [],
                  $hash = null,
          Severity: Major
          Found in src/Core/Url.php - About 1 hr to fix

            Method build has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $scheme = null,
                    $host = null,
                    $path = null,
                    array $query = [],
                    $hash = null,
            Severity: Major
            Found in src/Core/Url.php - About 1 hr to fix

              Method build has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $scheme = null,
                      $host = null,
                      $path = null,
                      array $query = [],
                      $hash = null,
              Severity: Major
              Found in src/Core/UrlArchive.php - About 1 hr to fix

                Method build has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $scheme,
                        $host,
                        $path = null,
                        array $query = [],
                        $hash = null,
                Severity: Major
                Found in src/Core/Url/UrlArchiveInterface.php - About 1 hr to fix

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

                      public function resolve($url, $as = null)
                      {
                          if (null === $as) {
                              $as = static::class;
                              $implements = class_implements($as, true);
                  Severity: Minor
                  Found in src/Core/Url/UrlArchiveTrait.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

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

                          array $httpResponseHeaders,
                          $httpResponseStatus,
                          $pageContent,
                          $pageEvaluated,
                          UrlArchive $initialUrl,
                  Severity: Major
                  Found in src/Core/Http/SearchEngineResponse.php - About 50 mins to fix

                    Function initWithDefaults has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function initWithDefaults(
                            $scheme = null,
                            $host = null,
                            $path = null,
                            array $query = [],
                    Severity: Minor
                    Found in src/Core/Url/UrlArchiveTrait.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 queryItemToString has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function queryItemToString($value)
                        {
                    
                            if (is_string($value)) {
                                if (strlen($value) > 0) {
                    Severity: Minor
                    Found in src/Core/Url/QueryParam.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 setParams has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function setParams(array $params)
                        {
                            $this->query = [];
                            foreach ($params as $k => $v) {
                                if (is_object($v)) {
                    Severity: Minor
                    Found in src/Core/Url/AlterableUrlTrait.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 requestFromForm has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            \DOMElement $formNode,
                            array $formData = [],
                            $strict = true,
                            $submit = true,
                            RequestInterface $request = null
                    Severity: Minor
                    Found in src/Core/Dom/WebPage.php - About 35 mins to fix

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

                          public function __construct($host, $port, $user = null, $password = null, $type = 'HTTP')
                      Severity: Minor
                      Found in src/Core/Http/Proxy.php - About 35 mins to fix

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

                            public function all($domain = null, $path = null, $name = null, $skipDiscardable = false, $skipExpired = true);
                        Severity: Minor
                        Found in src/Core/Cookie/CookieJarInterface.php - About 35 mins to fix

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

                                  HttpClientInterface $httpClient,
                                  $userAgent = null,
                                  $acceptLanguage = null,
                                  CookieJarInterface $cookieJar = null,
                                  ProxyInterface $proxy = null
                          Severity: Minor
                          Found in src/Core/Browser/Browser.php - About 35 mins to fix

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

                                    $captchaType,
                                    CaptchaSolverInterface $captchaSolver,
                                    $additionalMessage = null,
                                    $code = 0,
                                    Exception $previous = null
                            Severity: Minor
                            Found in src/Exception/CaptchaSolver/UnknownCaptchaTypeException.php - About 35 mins to fix

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

                                  public function all($domain = null, $path = null, $name = null, $skipDiscardable = false, $skipExpired = true)
                              Severity: Minor
                              Found in src/Core/Cookie/ArrayCookieJar.php - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language