travi/php-framework

View on GitHub
php/thirdparty/FeedCreator/include/feedcreator.class.php

Summary

Maintainability
F
1 wk
Test Coverage

File feedcreator.class.php has 848 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/***************************************************************************

FeedCreator class v1.7.2-ppt
originally (c) Kai Blankenhorn
Severity: Major
Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 2 days 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

    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 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 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

      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

        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

          Method createFeed has 52 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.= "<feed xmlns=\"http://www.w3.org/2005/Atom\"";
          Severity: Major
          Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 2 hrs to fix

            Method createFeed has 49 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.= "<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\"";
            Severity: Minor
            Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 1 hr to fix

              Function _setFormat has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  function _setFormat($format) {
                      switch (strtoupper($format)) {
                          
                          case "2.0":
                              // fall through
              Severity: Minor
              Found in php/thirdparty/FeedCreator/include/feedcreator.class.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 _setFormat has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _setFormat($format) {
                      switch (strtoupper($format)) {
                          
                          case "2.0":
                              // fall through
              Severity: Minor
              Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 1 hr to fix

                Method FeedDate has 43 lines of code (exceeds 25 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 1 hr to fix

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

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

                      function _setMIME($format) {
                          switch (strtoupper($format)) {
                              
                              case "2.0":
                                  // fall through
                  Severity: Minor
                  Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 1 hr to fix

                    Function qp_enc has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                        function qp_enc($input = "", $line_max = 76) { 
                            $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); 
                            $lines = preg_split("/(?:\r\n|\r|\n)/", $input); 
                            $eol = "\r\n"; 
                            $escape = "="; 
                    Severity: Minor
                    Found in php/thirdparty/FeedCreator/include/feedcreator.class.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 createFeed has 33 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.= "<opml xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n";
                    Severity: Minor
                    Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 1 hr to fix

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

                          function createFeed() {
                              $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
                              $feed.= $this->_createGeneratorComment();
                              $feed.= $this->_createStylesheetReferences();
                              $feed.= "<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\"";
                      Severity: Minor
                      Found in php/thirdparty/FeedCreator/include/feedcreator.class.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 _setMIME has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          function _setMIME($format) {
                              switch (strtoupper($format)) {
                                  
                                  case "2.0":
                                      // fall through
                      Severity: Minor
                      Found in php/thirdparty/FeedCreator/include/feedcreator.class.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 createFeed has a Cognitive Complexity of 11 (exceeds 5 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: Minor
                      Found in php/thirdparty/FeedCreator/include/feedcreator.class.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 createFeed has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function createFeed() {
                              $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
                              $feed.= $this->_createStylesheetReferences();
                              $feed.= "<feed version=\"0.1\" xmlns=\"http://example.com/newformat#\">\n"; 
                              $feed.= "    <title>".FeedCreator::iTrunc(htmlspecialchars($this->title),100)."</title>\n";
                      Severity: Minor
                      Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 1 hr to fix

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

                            function qp_enc($input = "", $line_max = 76) { 
                                $hex = array('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'); 
                                $lines = preg_split("/(?:\r\n|\r|\n)/", $input); 
                                $eol = "\r\n"; 
                                $escape = "="; 
                        Severity: Minor
                        Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 1 hr to fix

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

                              function createFeed() {
                                  $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n";
                                  $feed.= $this->_createStylesheetReferences();
                                  $feed.= "<feed version=\"0.1\" xmlns=\"http://example.com/newformat#\">\n"; 
                                  $feed.= "    <title>".FeedCreator::iTrunc(htmlspecialchars($this->title),100)."</title>\n";
                          Severity: Minor
                          Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 25 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 output has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function output() {
                                  // when field available and syndicated in html we assume 
                                  // - valid html in $rawFieldContent and we enclose in CDATA tags
                                  // - no truncation (truncating risks producing invalid html)
                                  if (!$this->rawFieldContent) {
                          Severity: Minor
                          Found in php/thirdparty/FeedCreator/include/feedcreator.class.php - About 25 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

                          There are no issues that match your filters.

                          Category
                          Status