ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

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

<?php
// 08/2008 Updated and adapted for ImpressCMS by evoc - webmaster of www.impresscms.it
// Published by ImpressCMS Italian Official Support Site - www.impresscms.it
// Updated by evoc - webmaster of Impresscms.it
// Updated by Ianez - Xoops Italia Staff
Severity: Major
Found in htdocs/modules/system/language/italiano/admin/groups.php and 5 other locations - About 3 days to fix
htdocs/modules/system/language/english/admin/findusers.php on lines 1..57
htdocs/modules/system/language/francais/admin/findusers.php on lines 1..54
htdocs/modules/system/language/italiano/admin/findusers.php on lines 1..63
htdocs/modules/system/language/italiano/modinfo.php on lines 1..75
htdocs/modules/system/language/nederlands/admin/findusers.php on lines 1..54

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

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

Function icms_cp_header has a Cognitive Complexity of 161 (exceeds 5 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: Minor
Found in htdocs/include/cp_functions.php - About 3 days 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

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

<?php
// $Id: modinfo.php 10326 2010-07-11 18:54:25Z malanciault $
// Module Info

// The name of this module
Severity: Major
Found in htdocs/modules/system/language/nederlands/modinfo.php and 1 other location - About 3 days to fix
htdocs/modules/system/language/english/modinfo.php on lines 1..72

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

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
// $Id: modinfo.php 10326 2010-07-11 18:54:25Z malanciault $
// Module Info

// The name of this module
Severity: Major
Found in htdocs/modules/system/language/english/modinfo.php and 1 other location - About 3 days to fix
htdocs/modules/system/language/nederlands/modinfo.php on lines 1..64

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

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 modulesadmin.php has 1190 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// $Id: modulesadmin.php 12403 2014-01-26 21:35:08Z skenow $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
Severity: Major
Found in htdocs/modules/system/admin/modulesadmin/modulesadmin.php - About 3 days to fix

    Function AdMenu has a Cognitive Complexity of 145 (exceeds 5 allowed). Consider refactoring.
    Open

    function AdMenu(id) { this.type = "horizontal"; this.position = { "level1": { "top": 0, "left": 0}, "levelX": { "top": 0, "left": 0}
    }
    this.zIndex = { "visible": 1, "hidden": -1
    }
    this.arrow1 = null; this.arrow2 = null; this.browser = { "ie": Boolean(document.body.currentStyle), "ie5": (navigator.appVersion.indexOf("MSIE 5.5") != -1 || navigator.appVersion.indexOf("MSIE 5.0") != -1)
    Severity: Minor
    Found in htdocs/include/icms_rtl.js - About 2 days 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

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

    <?php
    // $Id: blocks.php 9349 2009-09-06 19:25:40Z Phoenyx $
    // Blocks
    define('_MB_SYSTEM_ADMENU', 'Administratie Menu');
    define('_MB_SYSTEM_RNOW', 'Registreer Nu!');
    Severity: Major
    Found in htdocs/modules/system/language/nederlands/blocks.php and 2 other locations - About 2 days to fix
    htdocs/modules/system/language/english/blocks.php on lines 1..62
    htdocs/modules/system/language/francais/blocks.php on lines 1..60

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

    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
    // $Id: blocks.php 9349 2009-09-06 19:25:40Z Phoenyx $
    // Blocks
    define("_MB_SYSTEM_ADMENU","Administration Menu");
    define("_MB_SYSTEM_RNOW","Register now!");
    Severity: Major
    Found in htdocs/modules/system/language/english/blocks.php and 2 other locations - About 2 days to fix
    htdocs/modules/system/language/francais/blocks.php on lines 1..60
    htdocs/modules/system/language/nederlands/blocks.php on lines 1..60

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

    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
    // $Id: blocks.php 9347 2009-09-06 19:25:40Z Phoenyx $
    // Blocks
    define('_MB_SYSTEM_ADMENU', 'Administration');
    define('_MB_SYSTEM_RNOW', 'Inscrivez-vous!');
    Severity: Major
    Found in htdocs/modules/system/language/francais/blocks.php and 2 other locations - About 2 days to fix
    htdocs/modules/system/language/english/blocks.php on lines 1..62
    htdocs/modules/system/language/nederlands/blocks.php on lines 1..60

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

    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
    /**
    * Adsense.php definations
    *
    * @copyright      http://www.impresscms.org/ The ImpressCMS Project
    Severity: Major
    Found in htdocs/modules/system/language/english/admin/adsense.php and 2 other locations - About 2 days to fix
    htdocs/modules/system/language/italiano/admin/adsense.php on lines 1..51
    htdocs/modules/system/language/nederlands/admin/adsense.php on lines 1..53

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

    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
    /**
    * Adsense.php definations
    *
    * @copyright      http://www.impresscms.org/ The ImpressCMS Project
    Severity: Major
    Found in htdocs/modules/system/language/nederlands/admin/adsense.php and 2 other locations - About 2 days to fix
    htdocs/modules/system/language/english/admin/adsense.php on lines 1..52
    htdocs/modules/system/language/italiano/admin/adsense.php on lines 1..51

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

    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
    
    /**
    * $Id: adsense.php 159 2007-12-17 16:44:05Z malanciault $
    * Module: SmartContent
    Severity: Major
    Found in htdocs/modules/system/language/italiano/admin/adsense.php and 2 other locations - About 2 days to fix
    htdocs/modules/system/language/english/admin/adsense.php on lines 1..52
    htdocs/modules/system/language/nederlands/admin/adsense.php on lines 1..53

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

    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 main.php has 1044 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    // $Id: main.php 12399 2014-01-25 17:02:01Z skenow $
    //  ------------------------------------------------------------------------ //
    //                XOOPS - PHP Content Management System                      //
    //                    Copyright (c) 2000 XOOPS.org                           //
    Severity: Major
    Found in htdocs/modules/system/admin/tplsets/main.php - About 2 days to fix

      Method make_data has 490 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function make_data(&$dbm, &$cm, $adminname, $adminlogin_name, $adminpass, $adminmail, $language, $gruops) {
      
          $tables = array();
      
          // data for table 'groups_users_link'
      Severity: Major
      Found in htdocs/install/makedata.php - About 2 days to fix

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

                if ($handler = @opendir($tpl_path . '/')) {
                    while (($file = readdir($handler)) !== false) {
                        if (substr($file, 0, 1) == '.') continue;
                        $file_path = $tpl_path . '/' . $file;
                        if (is_file($file_path) && in_array(strrchr($file, '.'), array (
        htdocs/install/modules/protector/trust_path/modules/protector/onupdate.php on lines 39..74

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

        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

                if ($handler = @opendir($tpl_path . '/')) {
                    while (($file = readdir($handler)) !== false) {
                        if (substr($file, 0, 1) == '.') continue;
                        $file_path = $tpl_path . '/' . $file;
                        if (is_file($file_path) && in_array(strrchr($file, '.'), array (
        htdocs/install/modules/protector/trust_path/modules/protector/oninstall.php on lines 49..84

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

        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

        Function jdate has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring.
        Open

        function jdate($type,$maket='now') {
            global $icmsConfig;
            icms_loadLanguageFile('core', 'calendar');
            $result='';
            if ($maket=='now') {
        Severity: Minor
        Found in htdocs/include/jalali.php - About 2 days 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 945 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        // $Id: main.php 12460 2014-06-25 03:35:37Z skenow $
        // ------------------------------------------------------------------------ //
        // XOOPS - PHP Content Management System //
        // Copyright (c) 2000 XOOPS.org //
        Severity: Major
        Found in htdocs/modules/system/admin/images/main.php - About 2 days to fix

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

          <?php
          // $Id: mailusers.php 10326 2010-07-11 18:54:25Z malanciault $
          //%%%%%%    Admin Module Name  MailUsers    %%%%%
          if (!defined('_AM_DBUPDATED')) {define("_AM_DBUPDATED","Database Updated Successfully!");}
          
          
          Severity: Major
          Found in htdocs/modules/system/language/english/admin/mailusers.php and 2 other locations - About 2 days to fix
          htdocs/modules/system/language/francais/admin/mailusers.php on lines 1..39
          htdocs/modules/system/language/nederlands/admin/mailusers.php on lines 1..39

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

          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
          // $Id: mailusers.php 19775 2010-07-11 18:54:25Z malanciault $
          //%%%%%%    Admin Module Name  MailUsers    %%%%%
          if (!defined('_AM_DBUPDATED')) {define('_AM_DBUPDATED', 'Base de donn&eacute;es mise &agrave; jour avec succ&egrave;s!');
          }
          Severity: Major
          Found in htdocs/modules/system/language/francais/admin/mailusers.php and 2 other locations - About 2 days to fix
          htdocs/modules/system/language/english/admin/mailusers.php on lines 1..38
          htdocs/modules/system/language/nederlands/admin/mailusers.php on lines 1..39

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

          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