travi/php-framework

View on GitHub

Showing 140 of 176 total issues

Function createFeed has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
Open

    function createFeed() {
        $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
        $feed.= $this->_createGeneratorComment();
        $feed.= $this->_createStylesheetReferences();
        $feed.= "<rss version=\"".$this->RSSVersion."\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";
Severity: Minor
Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 4 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 addInstant has 117 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function addInstant() {
    var theimages = getImages('instant'); 
    var image; var object; var canvas; var context;  
    var border = 16; var offset = 8; var inset = 2; 
    var icolor = ''; var ishadow = 0; var noshading; 
Severity: Major
Found in client/thirdparty/instant/instant.js - About 4 hrs to fix

    Method fetch has 109 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function fetch($URI)
        {
        
            //preg_match("|^([^:]+)://([^:/]+)(:[\d]+)*(.*)|",$URI,$URI_PARTS);
            $URI_PARTS = parse_url($URI);
    Severity: Major
    Found in php/thirdparty/Snoopy/Snoopy.class.php - About 4 hrs to fix

      Method _httpsrequest has 106 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _httpsrequest($url,$URI,$http_method,$content_type="",$body="")
          {
              if($this->passcookies && $this->_redirectaddr)
                  $this->setcookies();
      
      Severity: Major
      Found in php/thirdparty/Snoopy/Snoopy.class.php - About 4 hrs to fix

        Method createFeed has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function createFeed() {
                $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
                $feed.= $this->_createGeneratorComment();
                $feed.= $this->_createStylesheetReferences();
                $feed.= "<rss version=\"".$this->RSSVersion."\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n";
        Severity: Major
        Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 4 hrs to fix

          Function _prepare_post_body has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              function _prepare_post_body($formvars, $formfiles)
              {
                  settype($formvars, "array");
                  settype($formfiles, "array");
          
          Severity: Minor
          Found in php/thirdparty/Snoopy/Snoopy.class.php - About 3 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 addIEInstant has 95 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function addIEInstant() {
              var theimages = getImages('instant');
              var image; var object; var vml; var display;
              var border = 16; var offset = 8; var scale = 1;
              var icolor = ''; var ishadow = 0; var noshading;
          Severity: Major
          Found in client/thirdparty/instant/instant.js - About 3 hrs to fix

            File jquery.lightbox.js has 313 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * jQuery lightBox plugin
             * This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
             * and adapted to me for use like a plugin from jQuery.
             * @name jquery-lightbox-0.5.js
            Severity: Minor
            Found in client/thirdparty/jquery/plugins/lightbox/jquery.lightbox.js - About 3 hrs to fix

              Function buildOptions has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function buildOptions() {
              
                      foreach ($this->_matches[1] as $command) {
              
                          $command = trim($command);
              Severity: Minor
              Found in php/thirdparty/PHP-Dependency/library/Pd/Map/Builder/Parser.php - About 3 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 createFeed has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  function createFeed() {
                      // if there is styleless output, use the content of this variable and ignore the rest
                      if ($this->stylelessOutput!="") {
                          return $this->stylelessOutput;
                      }
              Severity: Minor
              Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 3 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 get_mobile_data has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

              function get_mobile_data( $pv_browser_user_agent )
              {
                  $mobile_browser = '';
                  $mobile_browser_number = '';
                  $mobile_device = '';
              Severity: Minor
              Found in php/thirdparty/browser_detection.php - About 3 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 FeedDate has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  function FeedDate($dateString="") {
                      if ($dateString=="") $dateString = date("r");
                      
                      if (is_numeric($dateString)) {
                          $this->unix = $dateString;
              Severity: Minor
              Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 3 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 add has 81 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  add: function(image, options) {
                      Reflection.remove(image);
                      
                      doptions = { "height" : Reflection.defaultHeight, "opacity" : Reflection.defaultOpacity }
                      if (options) {
              Severity: Major
              Found in client/thirdparty/reflection/reflection.js - About 3 hrs to fix

                Request has 26 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Request
                {
                    const GET    = 'GET';
                    const POST   = 'POST';
                    const DELETE = 'DELETE';
                Severity: Minor
                Found in php/framework/src/travi/framework/http/Request.php - About 3 hrs to fix

                  Function add has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                      add: function(image, options) {
                          Reflection.remove(image);
                          
                          doptions = { "height" : Reflection.defaultHeight, "opacity" : Reflection.defaultOpacity }
                          if (options) {
                  Severity: Minor
                  Found in client/thirdparty/reflection/reflection.js - 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 createFeed has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function createFeed() {
                          // if there is styleless output, use the content of this variable and ignore the rest
                          if ($this->stylelessOutput!="") {
                              return $this->stylelessOutput;
                          }
                  Severity: Major
                  Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 2 hrs to fix

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

                        public function addDependencies($dependencies = array(), $component = null)
                        {
                            if ($this->environment->isProduction() && !empty($dependencies['production'])) {
                                $this->addDependencies($dependencies['production']);
                            }

                    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 get_mobile_data has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function get_mobile_data( $pv_browser_user_agent )
                    {
                        $mobile_browser = '';
                        $mobile_browser_number = '';
                        $mobile_device = '';
                    Severity: Major
                    Found in php/thirdparty/browser_detection.php - About 2 hrs to fix

                      Method __toString has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function __toString()
                          {
                              $hour = substr($this->getValue(), 0, 2);
                              if ($hour >= 12) {
                                  $ampm = 'pm';
                      Severity: Major
                      Found in php/framework/objects/travi/framework/content/form.class.php - About 2 hrs to fix

                        Method createFeed has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function createFeed() {     
                                $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
                                $feed.= $this->_createGeneratorComment();
                                if ($this->cssStyleSheet=="") {
                                    $cssStyleSheet = "http://www.w3.org/2000/08/w3c-synd/style.css";
                        Severity: Major
                        Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 2 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language