spotweb/spotweb

View on GitHub
lib/services/Providers/Services_Providers_Http.php

Summary

Maintainability
F
3 days
Test Coverage

Function perform has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
Open

    public function perform($url, $lastModTime = null, $redirTries = 0)
    {
        SpotTiming::start(__CLASS__.'::'.__FUNCTION__);

        /*
Severity: Minor
Found in lib/services/Providers/Services_Providers_Http.php - About 7 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 perform has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function perform($url, $lastModTime = null, $redirTries = 0)
    {
        SpotTiming::start(__CLASS__.'::'.__FUNCTION__);

        /*
Severity: Major
Found in lib/services/Providers/Services_Providers_Http.php - About 4 hrs to fix

    File Services_Providers_Http.php has 303 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    class Services_Providers_Http
    {
        private $_cacheDao;
    Severity: Minor
    Found in lib/services/Providers/Services_Providers_Http.php - About 3 hrs to fix

      Services_Providers_Http has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Services_Providers_Http
      {
          private $_cacheDao;
      
          /**
      Severity: Minor
      Found in lib/services/Providers/Services_Providers_Http.php - About 2 hrs to fix

        Function addPostFieldsToCurl has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            private function addPostFieldsToCurl($ch, $postFields, $files, $rawPostData)
            {
                /*
                 * Files posted to another webserver, need to be in another format
                 * than a plain post data to be posted.
        Severity: Minor
        Found in lib/services/Providers/Services_Providers_Http.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 performCachedGet has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            public function performCachedGet($url, $storeWhenRedirected, $ttl = 900)
            {
                SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
                $url_md5 = md5($url);
        
        
        Severity: Minor
        Found in lib/services/Providers/Services_Providers_Http.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 addPostFieldsToCurl has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function addPostFieldsToCurl($ch, $postFields, $files, $rawPostData)
            {
                /*
                 * Files posted to another webserver, need to be in another format
                 * than a plain post data to be posted.
        Severity: Minor
        Found in lib/services/Providers/Services_Providers_Http.php - About 1 hr to fix

          Method performCachedGet has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function performCachedGet($url, $storeWhenRedirected, $ttl = 900)
              {
                  SpotTiming::start(__CLASS__.'::'.__FUNCTION__);
                  $url_md5 = md5($url);
          
          
          Severity: Minor
          Found in lib/services/Providers/Services_Providers_Http.php - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status