ImpressCMS/impresscms

View on GitHub
htdocs/include/comment_post.php

Summary

Maintainability
B
5 hrs
Test Coverage

File comment_post.php has 357 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// $Id: comment_post.php 12313 2013-09-15 21:14:35Z skenow $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
Severity: Minor
Found in htdocs/include/comment_post.php - About 4 hrs to fix

    Consider simplifying this complex logical expression.
    Open

    if (!empty($_POST)) {
        if (isset($_POST['com_dopost'])) {
            $op = 'post';
        } elseif (isset($_POST['com_dopreview'])) {
            $op = 'preview';
    Severity: Major
    Found in htdocs/include/comment_post.php - About 40 mins to fix

      Reference to static property module from undeclared class \icms
      Open

          $comment_config = icms::$module->getInfo('comments');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

                      switch (icms::$module->config['com_rule']) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

          $moddir = icms::$module->getVar('dirname');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                      if (!icms::$user->isAdmin($com_modid)) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

      if ('system' == icms::$module->getVar('dirname')) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

          $module_handler = icms::handler('icms_module');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

              if (icms::$module->getVar('dirname') != 'system') {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

                      $sysperm_handler = icms::handler('icms_member_groupperm');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method icms_trim from undeclared class \icms_core_DataFilter
      Open

              $com_title = icms_core_DataFilter::icms_trim($_POST['com_title']);
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method checkVar from undeclared class \icms_core_DataFilter
      Open

              $comment->setVar('com_text', icms_core_DataFilter::checkVar($_POST['com_text'], 'html', 'input'));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method __construct from undeclared class \icms_db_criteria_Item
      Open

                          $criteria->add(new icms_db_criteria_Item('com_itemid', $com_itemid));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

                      if ('system' == icms::$module->getVar('dirname')) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

              $comment_handler = icms::handler('icms_data_comment');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                      if (icms::$user->isAdmin($com_modid)
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                      || $sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, icms::$user->getGroups())) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

                          switch (icms::$module->config['com_rule']) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to undeclared constant \_NOTITLE
      Open

              $com_title = ($com_title == '') ? _NOTITLE : $com_title;
      Severity: Minor
      Found in htdocs/include/comment_post.php by phan

      Call to method stripSlashesGPC from undeclared class \icms_core_DataFilter
      Open

              $com_title = icms_core_DataFilter::htmlSpecialChars(icms_core_DataFilter::stripSlashesGPC($_POST['com_title']));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                  if (is_object(icms::$user)) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                      if (icms::$user->isAdmin($com_modid)
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method add from undeclared class \icms_db_criteria_Compo
      Open

                          $criteria->add(new icms_db_criteria_Item('com_itemid', $com_itemid));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

                          $not_module =& icms::$module;
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to undeclared constant \_CM_THANKSPOST
      Open

                          2, _CM_THANKSPOST);
      Severity: Minor
      Found in htdocs/include/comment_post.php by phan

      Reference to undeclared constant \_CM_THANKSPOST
      Open

                          . '#comment' . $newcid, 2, _CM_THANKSPOST);
      Severity: Minor
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

          $com_modid = icms::$module->getVar('mid');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                  if (is_object(icms::$user)) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method htmlSpecialChars from undeclared class \icms_core_DataFilter
      Open

          $com_mode = isset($_POST['com_mode']) ? icms_core_DataFilter::htmlSpecialChars(trim($_POST['com_mode']), ENT_QUOTES) : 'flat';
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method htmlSpecialChars from undeclared class \icms_core_DataFilter
      Open

                                  ? $extra_param . '=' . icms_core_DataFilter::htmlSpecialChars(trim($_POST[$extra_param])) . '&amp;'
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method checkVar from undeclared class \icms_core_DataFilter
      Open

              $com_text = icms_core_DataFilter::checkVar($_POST['com_text'], 'html', 'output');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

                      if (!empty(icms::$module->config['com_anonpost']) && !empty($noname)) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

                      $notification_handler = icms::handler("icms_data_notification");
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

          $comment_handler = icms::handler('icms_data_comment');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                          if ($comment->getVar('com_uid') != icms::$user->getVar('uid')) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

      if (!defined('ICMS_ROOT_PATH') || !is_object(icms::$module)) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method instance from undeclared class \icms_form_elements_captcha_Object
      Open

                  $icmsCaptcha = icms_form_elements_captcha_Object::instance();
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                  if (is_object(icms::$user)) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

          if (XOOPS_COMMENT_APPROVENONE == icms::$module->config['com_rule']) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                      || $sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, icms::$user->getGroups())) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                          if (!$sysperm_handler->checkRight('system_admin', XOOPS_SYSTEM_COMMENT, icms::$user->getGroups())) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method error from undeclared class \icms_core_Message
      Open

                          icms_core_Message::error();
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

                      $member_handler = icms::handler('icms_member');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property security from undeclared class \icms
      Open

              redirect_header(ICMS_URL.'/',3, implode('<br />', icms::$security->getErrors()));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property module from undeclared class \icms
      Open

                      if (icms::$module->config['com_anonpost'] != 1) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property security from undeclared class \icms
      Open

              if (!icms::$security->check()) {
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

                          $sysperm_handler = icms::handler('icms_member_groupperm');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method checkVar from undeclared class \icms_core_DataFilter
      Open

              $p_comment =& icms_core_DataFilter::checkVar($_POST['com_text'], 'html', 'input');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method __construct from undeclared class \icms_db_criteria_Compo
      Open

                          $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('com_modid', $com_modid));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method __construct from undeclared class \icms_db_criteria_Item
      Open

                          $criteria->add(new icms_db_criteria_Item('com_status', XOOPS_COMMENT_ACTIVE));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method htmlSpecialChars from undeclared class \icms_core_DataFilter
      Open

                  ? $extra_param . '=' . icms_core_DataFilter::htmlSpecialChars(trim($_POST[$extra_param])) . '&amp;'
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

                      $sysperm_handler = icms::handler('icms_member_groupperm');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method __construct from undeclared class \icms_db_criteria_Item
      Open

                          $criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('com_modid', $com_modid));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to undeclared constant \_NOPERM
      Open

                      2, _NOPERM);
      Severity: Minor
      Found in htdocs/include/comment_post.php by phan

      Call to method add from undeclared class \icms_db_criteria_Compo
      Open

                          $criteria->add(new icms_db_criteria_Item('com_status', XOOPS_COMMENT_ACTIVE));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method handler from undeclared class \icms
      Open

                          $module_handler = icms::handler('icms_module');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method error from undeclared class \icms_core_Message
      Open

                      icms_core_Message::error($comment->getHtmlErrors());
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Call to method htmlSpecialChars from undeclared class \icms_core_DataFilter
      Open

              $com_title = icms_core_DataFilter::htmlSpecialChars(icms_core_DataFilter::stripSlashesGPC($_POST['com_title']));
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to static property user from undeclared class \icms
      Open

                          $uid = icms::$user->getVar('uid');
      Severity: Critical
      Found in htdocs/include/comment_post.php by phan

      Reference to undeclared constant \_NOPERM
      Open

                          1, _NOPERM);
      Severity: Minor
      Found in htdocs/include/comment_post.php by phan

      Terminating statement must be indented to the same level as the CASE body
      Open

                          break;

      Only one argument is allowed per line in a multi-line function call
      Open

                          1, _NOPERM);

      Only one argument is allowed per line in a multi-line function call
      Open

                      2, _NOPERM);

      Only one argument is allowed per line in a multi-line function call
      Open

                          2, _CM_THANKSPOST);

      Only one argument is allowed per line in a multi-line function call
      Open

                      2, $icmsCaptcha->getMessage());

      Closing parenthesis of a multi-line function call must be on a line by itself
      Open

                      2, $icmsCaptcha->getMessage());

      Opening parenthesis of a multi-line function call must be the last content on the line
      Open

                          redirect_header($redirect_page . '=' . $com_itemid . '&amp;com_id=' . $com_id . '&amp;com_mode=' . $com_mode . '&amp;com_order=' . $com_order,

      No space found after comma in function call
      Open

              redirect_header(ICMS_URL.'/',3, implode('<br />', icms::$security->getErrors()));

      Multi-line function call not indented correctly; expected 24 spaces but found 20
      Open

                          . $com_rootid . '&amp;com_mode=' . $com_mode . '&amp;com_order=' . $com_order . '#comment' . $newcid,

      Closing parenthesis of a multi-line function call must be on a line by itself
      Open

                          2, _CM_THANKSPOST);

      Opening parenthesis of a multi-line function call must be the last content on the line
      Open

                      redirect_header($redirect_page . '=' . $com_itemid . '&com_id=' . $com_id . '&com_mode=' . $com_mode . '&com_order=' . $com_order,

      Opening parenthesis of a multi-line function call must be the last content on the line
      Open

                      redirect_header($redirect_page . '=' . $com_itemid . '&amp;com_id=' . $com_id . '&amp;com_mode=' . $com_mode . '&amp;com_order=' . $com_order,

      Closing parenthesis of a multi-line function call must be on a line by itself
      Open

                          1, _NOPERM);

      Opening parenthesis of a multi-line function call must be the last content on the line
      Open

                          redirect_header($redirect_page . '=' . $com_itemid . '&amp;com_id=' . $newcid . '&amp;com_rootid='

      Expected 1 newline at end of file; 0 found
      Open

      }

      Closing parenthesis of a multi-line function call must be on a line by itself
      Open

                      2, _NOPERM);

      There are no issues that match your filters.

      Category
      Status