ImpressCMS/impresscms

View on GitHub

Showing 540 of 47,256 total issues

Function easiestml has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function easiestml($s) {
    global $easiestml_lang, $icmsConfigMultilang;

    // all mode for debug (allowed to system admin only)
    if (is_object(icms::$user) && icms::$user->isAdmin(1) && ! empty($_GET['lang']) && $_GET['lang'] == 'all') {
Severity: Minor
Found in htdocs/include/im_multilanguage.php - 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

Function modifyGroup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function modifyGroup($g_id) {
    $userstart = $memstart = 0;
    if (!empty($_POST['userstart'])) {
        $userstart = (int) $_POST['userstart'];
    } elseif (!empty($_GET['userstart'])) {
Severity: Minor
Found in htdocs/modules/system/admin/groups/groups.php - 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

Function SmilesAdmin has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

function SmilesAdmin() {
    $db =& icms_db_Factory::instance();
    $url_smiles = ICMS_UPLOAD_URL;
    icms_cp_header();
    echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/smilies/images/smilies_big.png)">' . _AM_SMILESCONTROL . '</div><br />';
Severity: Minor
Found in htdocs/modules/system/admin/smilies/smilies.php - 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

Function doRewrite has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    function doRewrite() {
        clearstatcache();
        if (! $file = fopen($this->path,"r")) {
            $this->error = true;
            return false;
Severity: Minor
Found in htdocs/install/class/mainfilemanager.php - 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

Function Serializers has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Form.Element.Serializers = (function() {
    function input(element, value) {
        switch (element.type.toLowerCase()) {
            case 'checkbox':
            case 'radio':
Severity: Major
Found in htdocs/install/prototype.js - About 2 hrs to fix

    Method modifyUser has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function modifyUser($user) {
        global $icmsConfig, $icmsModule;
        icms_cp_header();
        echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/users/images/users_big.png)">' . _MD_AM_USER . '</div><br />';
        $member_handler = icms::handler('icms_member');
    Severity: Major
    Found in htdocs/modules/system/admin/users/users.php - About 2 hrs to fix

      Function CHILD has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  "CHILD": function( type, what, argument, first, last ) {
                      var simple = type.slice( 0, 3 ) !== "nth",
                          forward = type.slice( -4 ) !== "last",
                          ofType = what === "of-type";
      
      
      Severity: Major
      Found in htdocs/install/prototype.js - About 2 hrs to fix

        Method xoops_header has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function xoops_header($closehead=true) {
            global $icmsConfig, $xoopsTheme, $icmsConfigPlugins, $icmsConfigMetaFooter;
            $myts =& icms_core_Textsanitizer::getInstance();
        
            if(!headers_sent())
        Severity: Major
        Found in htdocs/include/functions.php - About 2 hrs to fix

          Method imanager_updateimage has 59 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function imanager_updateimage() {
              if (!icms::$security->check()) {
                  redirect_header('admin.php?fct=images', 3, implode('<br />', icms::$security->getErrors()));
              }
          
          
          Severity: Major
          Found in htdocs/modules/system/admin/images/main.php - About 2 hrs to fix

            File search.php has 265 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Method b_system_waiting_show has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function b_system_waiting_show($options) {
                  global $icmsConfig;
              
                  $userlang = $icmsConfig['language'] ;
              
              
              Severity: Major
              Found in htdocs/modules/system/blocks/system_waiting.php - About 2 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                    if ( text != null && text != "" ) {
                        if (enterCodeLangPhrase == null) {
                            enterCodeLangPhrase = "Now, enter the language of your code.";
                        }
                        if (CodeLangTypePhrase == null) {
                Severity: Critical
                Found in htdocs/include/xoops.js - About 2 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                                              if ( forward && useCache ) {
                                                  outerCache = parent[ expando ] || (parent[ expando ] = {});
                                                  cache = outerCache[ type ] || [];
                                                  nodeIndex = cache[0] === dirruns && cache[1];
                                                  diff = cache[0] === dirruns && cache[2];
                  Severity: Critical
                  Found in htdocs/install/prototype.js - About 2 hrs to fix

                    Method blocks_engine_upgrade has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function blocks_engine_upgrade() {
                            echo '<h2>Updating blocks engine </h2>';
                            if (!$this->table_exists('block_positions')) {
                                $xoopsDB = $GLOBALS['xoopsDB'];
                                $query = "CREATE TABLE `" . $xoopsDB->prefix('block_positions') . "` (
                    Severity: Major
                    Found in upgrade/upd-2.0.18-to-impresscms-1.0/index.php - About 2 hrs to fix

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

                      function xoops_module_list() {
                          global $icmsAdminTpl, $icmsConfig;
                      
                          $icmsAdminTpl->assign('lang_madmin', _MD_AM_MODADMIN);
                          $icmsAdminTpl->assign('lang_module', _MD_AM_MODULE);
                      Severity: Major
                      Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php - About 2 hrs to fix

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

                        function SmilesAdmin() {
                            $db =& icms_db_Factory::instance();
                            $url_smiles = ICMS_UPLOAD_URL;
                            icms_cp_header();
                            echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/smilies/images/smilies_big.png)">' . _AM_SMILESCONTROL . '</div><br />';
                        Severity: Major
                        Found in htdocs/modules/system/admin/smilies/smilies.php - About 2 hrs to fix

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

                          function b_system_admin_modules_show() {
                              $block['mods'] = array();
                              $module_handler = icms::handler('icms_module');
                              $moduleperm_handler = icms::handler('icms_member_groupperm');
                              $criteria = new icms_db_criteria_Compo();
                          Severity: Major
                          Found in htdocs/modules/system/blocks/system_admin_blocks.php - About 2 hrs to fix

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

                            function imanager_updatecat() {
                                /* because we are using a function, the GET/POST variables are not in scope */
                                global $imgcat_id, $imgcat_name, $imgcat_display, $imgcat_maxsize, $imgcat_maxwidth, $imgcat_maxheight, $imgcat_weight, $readgroup, $writegroup;
                                if (!icms::$security->check() || $imgcat_id <= 0) {
                                    redirect_header('admin.php?fct=images', 1, implode('<br />', icms::$security->getErrors()));
                            Severity: Major
                            Found in htdocs/modules/system/admin/images/main.php - About 2 hrs to fix

                              Function xoopsValidate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function xoopsValidate(subjectId, textareaId, submitId, plzCompletePhrase, msgTooLongPhrase, allowedCharPhrase, currCharPhrase) {
                                  var maxchars = 65535;
                                  var subjectDom = xoopsGetElementById(subjectId);
                                  var textareaDom = xoopsGetElementById(textareaId);
                                  var submitDom = xoopsGetElementById(submitId);
                              Severity: Minor
                              Found in htdocs/include/xoops.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

                              Function apply_0523patch has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  function apply_0523patch() {
                                      $patchCode = "
                                  foreach ( array('GLOBALS', '_SESSION', 'HTTP_SESSION_VARS', '_GET', 'HTTP_GET_VARS', '_POST', 'HTTP_POST_VARS', '_COOKIE', 'HTTP_COOKIE_VARS', '_REQUEST', '_SERVER', 'HTTP_SERVER_VARS', '_ENV', 'HTTP_ENV_VARS', '_FILES', 'HTTP_POST_FILES', 'xoopsDB', 'xoopsUser', 'xoopsUserId', 'xoopsUserGroups', 'xoopsUserIsAdmin', 'xoopsConfig', 'xoopsOption', 'xoopsModule', 'xoopsModuleConfig', 'xoopsRequestUri') as \$bad_global) {
                                      if (isset( \$_REQUEST[\$bad_global] )) {
                                          header( 'Location: '.XOOPS_URL.'/' );
                              Severity: Minor
                              Found in upgrade/upd-2.0.13-to-2.0.14/index.php - 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

                              Severity
                              Category
                              Status
                              Source
                              Language