e107inc/e107

View on GitHub
e107_handlers/comment_class.php

Summary

Maintainability
B
6 hrs
Test Coverage
F
29%

Method form_comment has 9 arguments (exceeds 7 allowed). Consider refactoring.
Open

    function form_comment($action, $table, $id, $subject, $content_type, $return = FALSE, $rating = FALSE, $tablerender = TRUE,$pid = false)
Severity: Major
Found in e107_handlers/comment_class.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                        if ($installed = isset($pref['plug_installed'][$var['plugin_path']]))
                                        {
                                            $qryp = str_replace("{NID}", $row['comment_item_id'], $var['qry']);
                                            if ($sql2->gen($qryp))
                                            {
    Severity: Major
    Found in e107_handlers/comment_class.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                          if ($sql2->select($var['db_table'], $var['db_title'], $var['db_id']." = '".$row['comment_item_id']."' "))
                                          {
                                              $row2 = $sql2->fetch();
                                              $ret['comment_type'] = $var['plugin_name'];
                                              $ret['comment_title'] = $tp->toHTML($row2[$var['db_title']], TRUE, 'emotes_off, no_make_clickable');
      Severity: Major
      Found in e107_handlers/comment_class.php - About 45 mins to fix

        Method compose_comment has 8 arguments (exceeds 7 allowed). Consider refactoring.
        Open

            function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE, $return = FALSE, $tablerender = TRUE)
        Severity: Major
        Found in e107_handlers/comment_class.php - About 35 mins to fix

          Avoid too many return statements within this method.
          Open

                      return $ns->tablerender("<span id='e-comment-total'>".$this->totalComments."</span> ".LAN_COMMENTS, $TEMPL, 'comment', true);
          Severity: Major
          Found in e107_handlers/comment_class.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return emessage;    
            Severity: Major
            Found in e107_handlers/comment_class.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                      return false; //3rd party code interception
              Severity: Major
              Found in e107_handlers/comment_class.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return $inserted_id; // return the ID number so it can be used. true;
                Severity: Major
                Found in e107_handlers/comment_class.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                              return "Error";    
                  Severity: Major
                  Found in e107_handlers/comment_class.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return 'ro';
                    Severity: Major
                    Found in e107_handlers/comment_class.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return false;
                      Severity: Major
                      Found in e107_handlers/comment_class.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return (!$return) ? "" : $ret;
                        Severity: Major
                        Found in e107_handlers/comment_class.php - About 30 mins to fix

                          Returning type null but form_comment() is declared to return string
                          Open

                                      return null;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Parameter $table has undeclared type \unknown_type
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Argument 1 (caption) is null but \e_render::tablerender() takes string defined at /code/e107_handlers/e_render_class.php:314
                          Open

                                              echo $ns->tablerender(null, $text, 'comment', true);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Returning type ?string but form_comment() is declared to return string
                          Open

                                      return $text;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $plugin_name is undeclared
                          Open

                                                      $e_comment['plugin_name'] = $plugin_name;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Default value for \unknown_type $rateindex can't be false
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Parameter $pid has undeclared type \unknown_type
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Parameter $id has undeclared type \unknown_type
                          Open

                              function count_comments($table, $id)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Call to deprecated function \getperms() defined at /code/class2.php:1322
                          Open

                                      if($this->totalComments && getperms("B"))
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Call to deprecated function \getperms() defined at /code/class2.php:1322
                          Open

                                  if(!getperms('0') && !getperms("B"))
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious array access to ?mixed
                          Open

                                                                  $ret['comment_title'] = $tp->toHTML($row2[$var['db_title']], TRUE, 'emotes_off, no_make_clickable');
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Parameter $rateindex has undeclared type \unknown_type
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Parameter $type has undeclared type \str
                          Open

                              public function getNested($pid, $type)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Argument 3 (default) is 'e107' but \e107::pref() takes null defined at /code/e107_handlers/e107_class.php:4016
                          Open

                                  $this->engine = e107::pref('core', 'comments_engine', 'e107');
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Call to deprecated function \getperms() defined at /code/class2.php:1322
                          Open

                                  if(getperms('B')) // moderator perms. 
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Default value for \unknown_type $comment can't be string
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Default value for \unknown_type $pid can't be string
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Parameter $subject has undeclared type \unknown_type
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $ret was undeclared, but array fields are being added to it.
                          Open

                                          $ret['comment'] = $text;
                          Severity: Info
                          Found in e107_handlers/comment_class.php by phan

                          Saw possibly unextractable annotation for a fragment of comment '* @param array - a row from the comments table.': after array, did not see an element name (will guess based on comment order)
                          Open

                               * @param array - a row from the comments table. 
                          Severity: Info
                          Found in e107_handlers/comment_class.php by phan

                          Parameter $comment has undeclared type \unknown_type
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious array access to ?mixed
                          Open

                                                              if ($sql2->select($var['db_table'], $var['db_title'], $var['db_id']." = '".$row['comment_item_id']."' "))
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious argument null for an echo/print statement
                          Open

                                              echo $ns->tablerender(null, $text, 'comment', true);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious argument array|bool for an echo/print statement
                          Open

                                              echo $text;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Default value for \unknown_type $table can't be string
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Argument 1 (caption) is null but \e_render::tablerender() takes string defined at /code/e107_handlers/e_render_class.php:314
                          Open

                                          return $ns->tablerender(null, $text, 'comment', true);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Call to deprecated function \getperms() defined at /code/class2.php:1322
                          Open

                                  if(!getperms('0') && !getperms("B"))
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Default value for int $id can't be string
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Argument 2 (text) is array|bool but \e_render::tablerender() takes string defined at /code/e107_handlers/e_render_class.php:314
                          Open

                                          return $ns->tablerender(null, $text, 'comment', true);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Default value for int $addrating can't be false
                          Open

                              function render_comment($row, $table, $action, $id, $width=0, $subject='', $addrating = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Parameter $table has undeclared type \unknown_type
                          Open

                              function count_comments($table, $id)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Argument 1 (table) is \unknown_type but \comment::getCommentType() takes string defined at /code/e107_handlers/comment_class.php:914
                          Open

                                  $type = $this->getCommentType($table);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $plugin_path is undeclared
                          Open

                                                      $e_comment['plugin_path'] = $plugin_path;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Default value for \unknown_type $subject can't be string
                          Open

                              function enter_comment($data, $comment='', $table='', $id='', $pid='', $subject='', $rateindex = FALSE)
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious argument null for an echo/print statement
                          Open

                                              echo $ns->tablerender("<span id='e-comment-total'>".$this->totalComments."</span> ".LAN_COMMENTS, $TEMPL, 'comment', TRUE);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Argument 2 (text) is array|bool but \e_render::tablerender() takes string defined at /code/e107_handlers/e_render_class.php:314
                          Open

                                              echo $ns->tablerender(null, $text, 'comment', true);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious array access to ?mixed
                          Open

                                                                  $ret['comment_type'] = $var['plugin_name'];
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious array access to false
                          Open

                                                      $data[$key] = $e_comment;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $link_name is undeclared
                          Open

                                                      $e_comment['db_title'] = $link_name;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $e_comment is undeclared
                          Open

                                              unset($e_comment, $key);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Argument 2 (fields) is true but \e_db::retrieve() takes string defined at /code/e107_handlers/e_db_interface.php:153
                          Open

                                  if ($rows = $sql->retrieve($query,true))
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $reply_location is undeclared
                          Open

                                                      $e_comment['reply_location'] = $reply_location;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious array access to false
                          Open

                                                      $data[$key] = $e_comment;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious array access to ?mixed
                          Open

                                                                  $ret['comment_url'] = str_replace("{NID}", $row['comment_item_id'], $var['reply_location']);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious array access to ?mixed
                          Open

                                                                  $ret['comment_category_heading'] = $var['plugin_name'];
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Argument 2 (fields) is true but \e_db::retrieve() takes string defined at /code/e107_handlers/e_db_interface.php:153
                          Open

                                  if($nested = e107::getDb()->retrieve($query, true))
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $key is undeclared
                          Open

                                              unset($e_comment, $key);
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $db_id is undeclared
                          Open

                                                      $e_comment['db_id'] = $db_id;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Variable $db_table is undeclared
                          Open

                                                      $e_comment['db_table'] = $db_table;
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          Suspicious array access to ?mixed
                          Open

                                                                  $ret['comment_category_url'] = e_PLUGIN_ABS.$var['plugin_name'].'/'.$var['plugin_name'].'.php';
                          Severity: Minor
                          Found in e107_handlers/comment_class.php by phan

                          There are no issues that match your filters.

                          Category
                          Status