travi/php-framework

View on GitHub

Showing 176 of 176 total issues

Method _httprequest has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    AbstractResponse has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    abstract class AbstractResponse
    {
        const LINK_ATTR_RSS_TYPE = 'application/rss+xml';
        const LINK_ATTR_REL_ALTERNATE = 'alternate';
    
    
    Severity: Minor
    Found in php/framework/objects/travi/framework/page/AbstractResponse.php - About 5 hrs to fix

      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

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
                          {
                              $this->results[] = $results;
                              for($x=0; $x<count($match[1]); $x++)
                                  $this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
                  Severity: Major
                  Found in php/thirdparty/Snoopy/Snoopy.class.php and 1 other location - About 3 hrs to fix
                  php/thirdparty/Snoopy/Snoopy.class.php on lines 714..725

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 148.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                          if(($this->_framedepth < $this->maxframes) && preg_match_all("'<frame\s+.*src[\s]*=[\'\"]?([^\'\"\>]+)'i",$results,$match))
                          {
                              $this->results[] = $results;
                              for($x=0; $x<count($match[1]); $x++)
                                  $this->_frameurls[] = $this->_expandlinks($match[1][$x],$URI_PARTS["scheme"]."://".$this->host);
                  Severity: Major
                  Found in php/thirdparty/Snoopy/Snoopy.class.php and 1 other location - About 3 hrs to fix
                  php/thirdparty/Snoopy/Snoopy.class.php on lines 565..576

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 148.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if (self.pageYOffset) {
                                  yScroll = self.pageYOffset;
                                  xScroll = self.pageXOffset;
                              } else if (document.documentElement && document.documentElement.scrollTop) {     // Explorer 6 Strict
                                  yScroll = document.documentElement.scrollTop;
                  Severity: Major
                  Found in client/thirdparty/jquery/plugins/lightbox/jquery.lightbox.js and 1 other location - About 3 hrs to fix
                  client/thirdparty/jquery/plugins/lightbox/jquery.lightbox.js on lines 434..447

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 100.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if (self.innerHeight) {    // all except Explorer
                                  if(document.documentElement.clientWidth){
                                      windowWidth = document.documentElement.clientWidth;
                                  } else {
                                      windowWidth = self.innerWidth;
                  Severity: Major
                  Found in client/thirdparty/jquery/plugins/lightbox/jquery.lightbox.js and 1 other location - About 3 hrs to fix
                  client/thirdparty/jquery/plugins/lightbox/jquery.lightbox.js on lines 471..480

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 100.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  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
                      Severity
                      Category
                      Status
                      Source
                      Language