ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

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

<?php

define('_CO_ICMS_MIMETYPES','Mime types');
define('_CO_ICMS_MIMETYPES_DSC', 'Questa &egrave; una lista di mime types disponibile nel sistema.');
define('_CO_ICMS_MIMETYPE', 'Mime type');
Severity: Major
Found in htdocs/modules/system/language/italiano/admin/mimetype.php and 2 other locations - About 1 day to fix
htdocs/modules/system/language/english/admin/mimetype.php on lines 1..30
htdocs/modules/system/language/nederlands/admin/mimetype.php on lines 1..30

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

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 3 locations. Consider refactoring.
Open

<?php

define('_CO_ICMS_MIMETYPES','Mime types');
define('_CO_ICMS_MIMETYPES_DSC', 'Here is a list of the mime types available in the system.');
define('_CO_ICMS_MIMETYPE', 'Mime type');
Severity: Major
Found in htdocs/modules/system/language/english/admin/mimetype.php and 2 other locations - About 1 day to fix
htdocs/modules/system/language/italiano/admin/mimetype.php on lines 1..29
htdocs/modules/system/language/nederlands/admin/mimetype.php on lines 1..30

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

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 3 locations. Consider refactoring.
Open

<?php

define('_CO_ICMS_MIMETYPES','Mime types');
define('_CO_ICMS_MIMETYPES_DSC', 'Hier is een overzicht van de beschikbare mime types die beschikbaar zijn in het systeem.');
define('_CO_ICMS_MIMETYPE', 'Mime type');
htdocs/modules/system/language/english/admin/mimetype.php on lines 1..30
htdocs/modules/system/language/italiano/admin/mimetype.php on lines 1..29

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

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

    $dbm->insert('config', " VALUES (" . ++$i . ", 0, $c, 'avatar_allow_upload', '_MD_AM_AVATARALLOW', '0', '_MD_AM_AVATARALWDSC', 'yesno', 'int', " . $p++ . ")"
        . ", (" . ++$i . ", 0, $c, 'avatar_allow_gravatar', '_MD_AM_GRAVATARALLOW', '1', '_MD_AM_GRAVATARALWDSC', 'yesno', 'int', " . $p++ . ")"
    /* the avatar resizer shall later be included
     $dbm->insert('config', " VALUES (" . ++$i . ", 0, $c, 'avatar_auto_resize', '_MD_AM_AUTORESIZE', '0', '_MD_AM_AUTORESIZE_DESC', 'yesno', 'int', " . $p++ . ")");
     */
Severity: Major
Found in htdocs/install/makedata.php and 1 other location - About 1 day to fix
htdocs/install/makedata.php on lines 527..537

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

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

    $dbm->insert('config', " VALUES (" . ++$i . ", 0, $c, 'email_font', '_MD_AM_EMAILTTF', 'arial.ttf', '_MD_AM_EMAILTTF_DESC', 'select_font', 'text', " . $p++ . ")"
        . ", (" . ++$i . ", 0, $c, 'email_font_len', '_MD_AM_EMAILLEN', '10', '_MD_AM_EMAILLEN_DESC', 'textbox', 'int', " . $p++ . ")"
        . ", (" . ++$i . ", 0, $c, 'email_cor', '_MD_AM_EMAILCOLOR', '#000000', '_MD_AM_EMAILCOLOR_DESC', 'color', 'text', " . $p++ . ")"
        . ", (" . ++$i . ", 0, $c, 'email_shadow', '_MD_AM_EMAILSHADOW', '#cccccc', '_MD_AM_EMAILSHADOW_DESC', 'color', 'text', " . $p++ . ")"
        . ", (" . ++$i . ", 0, $c, 'shadow_x', '_MD_AM_SHADOWX', '2', '_MD_AM_SHADOWX_DESC', 'textbox', 'int', " . $p++ . ")"
Severity: Major
Found in htdocs/install/makedata.php and 1 other location - About 1 day to fix
htdocs/install/makedata.php on lines 350..363

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

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 ($imagecategory->getVar('imgcat_storetype') == 'db') {
        $src = ICMS_MODULES_URL . "/system/admin/images/preview.php?file=" . $image->getVar('image_name') . '&resize=0';
        $img = WideImage::load($image->getVar('image_body'))->saveToFile(ICMS_IMANAGER_FOLDER_PATH . '/' . $image->getVar('image_name'));
        $fp = @fopen(ICMS_IMANAGER_FOLDER_PATH . '/' . $image->getVar('image_name'), 'rb');
        $fbinary = @fread($fp, filesize(ICMS_IMANAGER_FOLDER_PATH . '/' . $image->getVar('image_name')));
Severity: Major
Found in htdocs/modules/system/admin/images/main.php and 1 other location - About 1 day to fix
htdocs/modules/system/admin/images/browser.php on lines 847..859

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

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 ($imagecategory->getVar('imgcat_storetype') == 'db') {
        $src = ICMS_MODULES_URL . "/system/admin/images/preview.php?file=" . $image->getVar('image_name') . '&resize=0';
        $img = WideImage::load($image->getVar('image_body'))->saveToFile(ICMS_IMANAGER_FOLDER_PATH . '/' . $image->getVar('image_name'));
        $fp = @fopen(ICMS_IMANAGER_FOLDER_PATH . '/' . $image->getVar('image_name'), 'rb');
        $fbinary = @fread($fp, filesize(ICMS_IMANAGER_FOLDER_PATH . '/' . $image->getVar('image_name')));
Severity: Major
Found in htdocs/modules/system/admin/images/browser.php and 1 other location - About 1 day to fix
htdocs/modules/system/admin/images/main.php on lines 1092..1104

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

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

File preferences.php has 593 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// $Id: preferences.php 9546 2009-11-14 12:16:02Z Phoenyx $
//%%%%%%    Admin Module Name  AdminGroup     %%%%%
// dont change
if(!defined('_AM_DBUPDATED')){define("_AM_DBUPDATED","Database succesvol bijgewerkt!");}
Severity: Major
Found in htdocs/modules/system/language/nederlands/admin/preferences.php - About 1 day to fix

    File update-112-to-122.php has 580 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * DataBase Update Functions - 1.1.2 to 1.2.2 release
     *
     * @copyright    The ImpressCMS Project http://www.impresscms.org/
    Severity: Major
    Found in htdocs/modules/system/include/update-112-to-122.php - About 1 day to fix

      Function xoops_module_update_system has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

      function xoops_module_update_system(&$module, $oldversion = null, $dbVersion = null) {
          global $xoTheme;
      
          $from_112 = $abortUpdate = false;
      
      
      Severity: Minor
      Found in htdocs/modules/system/include/update.php - About 1 day 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

      File main.php has 559 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      // $Id: main.php 12455 2014-06-24 09:30:49Z sato-san $
      //  ------------------------------------------------------------------------ //
      //                XOOPS - PHP Content Management System                      //
      //                    Copyright (c) 2000 XOOPS.org                           //
      Severity: Major
      Found in htdocs/modules/system/admin/preferences/main.php - About 1 day to fix

        Method icms_cp_header has 234 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function icms_cp_header() {
            global $icmsConfig, $icmsConfigPlugins, $icmsConfigPersona, $xoopsModule, $xoopsTpl, $xoopsOption, $icmsTheme, $xoTheme, $icmsConfigMultilang, $icmsAdminTpl;
        
            icms::$logger->stopTime('Module init');
            icms::$logger->startTime('ImpressCMS CP Output Init');
        Severity: Major
        Found in htdocs/include/cp_functions.php - About 1 day to fix

          File system_blocks.php has 553 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          // $Id: system_blocks.php 12313 2013-09-15 21:14:35Z skenow $
          // ------------------------------------------------------------------------ //
          // XOOPS - PHP Content Management System //
          Severity: Major
          Found in htdocs/modules/system/blocks/system_blocks.php - About 1 day to fix

            Function protector_oninstall_base has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
            Open

                function protector_oninstall_base($module, $mydirname) {
                    // transations on module install
                    global $ret; // TODO :-D
            
                    if (!is_array($ret)) $ret = array ();

            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 setDocument has 215 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                setDocument = Sizzle.setDocument = function( node ) {
                    var hasCompare,
                        doc = node ? node.ownerDocument || node : preferredDoc,
                        parent = doc.defaultView;
            
            
            Severity: Major
            Found in htdocs/install/prototype.js - About 1 day to fix

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

              <?php
              
              class upgrade_2017 {
              
                  var $usedFiles = array( );
              Severity: Major
              Found in upgrade/upd-2.0.16-to-2.0.17/index.php and 1 other location - About 1 day to fix
              upgrade/upd-2.0.15-to-2.0.16/index.php on lines 1..65

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

              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

              <?php
              
              class upgrade_2016 {
              
                  var $usedFiles = array( );
              Severity: Major
              Found in upgrade/upd-2.0.15-to-2.0.16/index.php and 1 other location - About 1 day to fix
              upgrade/upd-2.0.16-to-2.0.17/index.php on lines 1..65

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

              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

              Method xoops_module_uninstall has 208 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function xoops_module_uninstall($dirname) {
                  global $icmsConfig, $icmsAdminTpl;
              
                  $reservedTables = array('avatar',
                      'avatar_users_link',
              Severity: Major
              Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php - About 1 day to fix

                File xoops.js has 512 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                if ( typeof window.$ != 'function' ) {
                    function $() {
                        var elements = new Array();
                
                        for (var i = 0; i < arguments.length; i++) {
                Severity: Major
                Found in htdocs/include/xoops.js - About 1 day to fix

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

                      if (!empty($icmsConfigPlugins['sanitizer_plugins'])) {
                          foreach ($icmsConfigPlugins['sanitizer_plugins'] as $key) {
                              if (empty($key)) continue;
                              if (file_exists(ICMS_ROOT_PATH . '/plugins/textsanitizer/' . $key . '/' . $key . '.css')) {
                                  $xoTheme->addStylesheet(ICMS_URL . '/plugins/textsanitizer/' . $key . '/' . $key . '.css', array('media' => 'screen'));
                  Severity: Major
                  Found in htdocs/include/cp_functions.php and 1 other location - About 1 day to fix
                  htdocs/header.php on lines 75..95

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

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language