ImpressCMS/impresscms

View on GitHub

Showing 47,251 of 47,256 total issues

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_PLUGINS_PATH . '/textsanitizer/' . $key . '/' . $key . '.css')) {
            $xoTheme->addStylesheet(ICMS_PLUGINS_URL . '/textsanitizer/' . $key . '/' . $key . '.css', array('media' => 'screen'));
Severity: Major
Found in htdocs/header.php and 1 other location - About 1 day to fix
htdocs/include/cp_functions.php on lines 183..203

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

Function Enumerable has 206 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Enumerable = (function() {
    function each(iterator, context) {
        try {
            this._each(iterator, context);
        } catch (e) {
Severity: Major
Found in htdocs/install/prototype.js - About 1 day to fix

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

        if ($id === FALSE) {
            return FALSE;
        } else {
            if ($id > 0) {
                $id = (int) $id;
    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 963..985

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

    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 ($id === FALSE) {
            return FALSE;
        } else {
            if ($id > 0) {
                $id = (int) $id;
    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 1131..1153

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

    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 formatTimestamp has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
    Open

    function formatTimestamp($time, $format = "l", $timeoffset = null)
    {
        global $icmsConfig;
    
        $format_copy = $format;
    Severity: Minor
    Found in htdocs/include/functions.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 makedata.php has 503 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /*
     You may not change or alter any portion of this comment or credits
     of supporting developers from this source code or any supporting source code
     which is considered copyrighted (c) material of the original comment or credit authors.
    Severity: Major
    Found in htdocs/install/makedata.php - About 1 day to fix

      File findusers.php has 498 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Finds users
       *
       * @copyright The XOOPS project http://www.xoops.org/
      Severity: Minor
      Found in htdocs/include/findusers.php - About 7 hrs to fix

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

                        echo '</td><td style="vertical-align: middle;">'
                            . '<a href="admin.php?fct=tplsets&amp;op=edittpl&amp;id=' . $templates[$i]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/edit.png" alt="' . _EDIT . '" title="' . _EDIT . '" /></a>'
                            . ' <a href="admin.php?fct=tplsets&amp;op=downloadtpl&amp;id=' . $templates[$i]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/filesave2.png" alt="' . _MD_DOWNLOAD . '" title="' . _MD_DOWNLOAD . '" /></a>'
                            . ' <a href="admin.php?fct=tplsets&amp;op=deletetpl&amp;id=' . $templates[$i]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/editdelete.png" alt="' . _DELETE . '" title="' . _DELETE . '" /></a>'
                            . '</td><td style="vertical-align: middle;" align="' . _GLOBAL_RIGHT . '"><input type="file" name="' . $filename . '" id="' . $filename . '" />'
        Severity: Major
        Found in htdocs/modules/system/admin/tplsets/main.php and 1 other location - About 7 hrs to fix
        htdocs/modules/system/admin/tplsets/main.php on lines 306..312

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

        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

                        echo '</td><td style="vertical-align: middle;">'
                            . '<a href="admin.php?fct=tplsets&amp;op=edittpl&amp;id=' . $btemplates[$j]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/edit.png" alt="' . _EDIT . '" title="' . _EDIT . '" /></a>'
                            . ' <a href="admin.php?fct=tplsets&amp;op=downloadtpl&amp;id=' . $btemplates[$j]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/filesave2.png" alt="' . _MD_DOWNLOAD . '" title="' . _MD_DOWNLOAD . '" /></a>'
                            . ' <a href="admin.php?fct=tplsets&amp;op=deletetpl&amp;id=' . $btemplates[$j]->getVar('tpl_id') . '"><img src="'. ICMS_IMAGES_SET_URL . '/actions/editdelete.png" alt="' . _DELETE . '" title="' . _DELETE . '" /></a>'
                            . '</td><td style="vertical-align: middle;" align="' . _GLOBAL_RIGHT . '"><input type="file" name="' . $filename . '" id="' . $filename . '" />'
        Severity: Major
        Found in htdocs/modules/system/admin/tplsets/main.php and 1 other location - About 7 hrs to fix
        htdocs/modules/system/admin/tplsets/main.php on lines 230..236

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

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

        <?php
        /**
         * Upgrade script of ImpressCMS 1.0 to 1.1
         *
         * @copyright    http://www.impresscms.org/ The ImpressCMS Project
        Severity: Minor
        Found in upgrade/upd-icms-1.0-to-1.1/index.php - About 7 hrs to fix

          Method imanager_listimg has 185 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function imanager_listimg($imgcat_id, $start = 0) {
              global $icmsTpl, $target, $type, $query, $limit;
          
              if (!is_object(icms::$user)) {
                  $groups = array(ICMS_GROUP_ANONYMOUS);
          Severity: Major
          Found in htdocs/modules/system/admin/images/browser.php - About 7 hrs to fix

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

                if (domobj.createTextRange && domobj.caretPos){
                      var caretPos = domobj.caretPos;
                    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) 
            == ' ' ? text + ' ' : text;  
                } else if (domobj.getSelection && domobj.caretPos){
            Severity: Major
            Found in htdocs/include/xoops.js and 1 other location - About 7 hrs to fix
            htdocs/modules/system/admin/images/js/imanager.js on lines 68..78

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

            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 (targetDom.createTextRange && targetDom.caretPos){
                    var caretPos = targetDom.caretPos;
                    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1)
                    == ' ' ? addCode + ' ' : addCode;
                } else if (targetDom.getSelection && targetDom.caretPos){
            Severity: Major
            Found in htdocs/modules/system/admin/images/js/imanager.js and 1 other location - About 7 hrs to fix
            htdocs/include/xoops.js on lines 191..201

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

            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 (!empty($user_icq)) {
                    $match = (!empty($user_icq_match)) ? (int) $user_icq_match : XOOPS_MATCH_START;
                    switch ($match) {
                        case XOOPS_MATCH_START:
                            $criteria->add(new icms_db_criteria_Item('user_icq', icms_core_DataFilter::addSlashes(trim($user_icq)) . '%', 'LIKE'));
            Severity: Major
            Found in htdocs/modules/system/admin/findusers/main.php and 1 other location - About 7 hrs to fix
            htdocs/modules/system/admin/findusers/main.php on lines 341..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 231.

            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 (!empty($user_msnm)) {
                    $match = (!empty($user_msnm_match)) ? (int) $user_msnm_match : XOOPS_MATCH_START;
                    switch ($match) {
                        case XOOPS_MATCH_START:
                            $criteria->add(new icms_db_criteria_Item('user_msnm', icms_core_DataFilter::addSlashes(trim($user_msnm)) . '%', 'LIKE'));
            Severity: Major
            Found in htdocs/modules/system/admin/findusers/main.php and 1 other location - About 7 hrs to fix
            htdocs/modules/system/admin/findusers/main.php on lines 272..294

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

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

                if (!empty($user_login_name)) {
                    $match = (!empty($user_login_name_match)) ? (int) $user_login_name_match : XOOPS_MATCH_START;
                    switch ($match) {
                        case XOOPS_MATCH_START:
                            $criteria->add(new icms_db_criteria_Item('login_name', icms_core_DataFilter::addSlashes(trim($user_login_name)) . '%', 'LIKE'));
            Severity: Major
            Found in htdocs/modules/system/admin/findusers/main.php and 5 other locations - About 7 hrs to fix
            htdocs/modules/system/admin/findusers/main.php on lines 176..198
            htdocs/modules/system/admin/findusers/main.php on lines 199..221
            htdocs/modules/system/admin/findusers/main.php on lines 245..267
            htdocs/modules/system/admin/findusers/main.php on lines 295..317
            htdocs/modules/system/admin/findusers/main.php on lines 318..340

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

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

                if (!empty($user_uname)) {
                    $match = (!empty($user_uname_match)) ? (int) $user_uname_match : XOOPS_MATCH_START;
                    switch ($match) {
                        case XOOPS_MATCH_START:
                            $criteria->add(new icms_db_criteria_Item('uname', icms_core_DataFilter::addSlashes(trim($user_uname)) . '%', 'LIKE'));
            Severity: Major
            Found in htdocs/modules/system/admin/findusers/main.php and 5 other locations - About 7 hrs to fix
            htdocs/modules/system/admin/findusers/main.php on lines 199..221
            htdocs/modules/system/admin/findusers/main.php on lines 222..244
            htdocs/modules/system/admin/findusers/main.php on lines 245..267
            htdocs/modules/system/admin/findusers/main.php on lines 295..317
            htdocs/modules/system/admin/findusers/main.php on lines 318..340

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

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

                if (!empty($user_aim)) {
                    $match = (!empty($user_aim_match)) ? (int) $user_aim_match : XOOPS_MATCH_START;
                    switch ($match) {
                        case XOOPS_MATCH_START:
                            $criteria->add(new icms_db_criteria_Item('user_aim', icms_core_DataFilter::addSlashes(trim($user_aim)) . '%', 'LIKE'));
            Severity: Major
            Found in htdocs/modules/system/admin/findusers/main.php and 5 other locations - About 7 hrs to fix
            htdocs/modules/system/admin/findusers/main.php on lines 176..198
            htdocs/modules/system/admin/findusers/main.php on lines 199..221
            htdocs/modules/system/admin/findusers/main.php on lines 222..244
            htdocs/modules/system/admin/findusers/main.php on lines 245..267
            htdocs/modules/system/admin/findusers/main.php on lines 318..340

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

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

                if (!empty($user_yim)) {
                    $match = (!empty($user_yim_match)) ? (int) $user_yim_match : XOOPS_MATCH_START;
                    switch ($match) {
                        case XOOPS_MATCH_START:
                            $criteria->add(new icms_db_criteria_Item('user_yim', icms_core_DataFilter::addSlashes(trim($user_yim)) . '%', 'LIKE'));
            Severity: Major
            Found in htdocs/modules/system/admin/findusers/main.php and 5 other locations - About 7 hrs to fix
            htdocs/modules/system/admin/findusers/main.php on lines 176..198
            htdocs/modules/system/admin/findusers/main.php on lines 199..221
            htdocs/modules/system/admin/findusers/main.php on lines 222..244
            htdocs/modules/system/admin/findusers/main.php on lines 245..267
            htdocs/modules/system/admin/findusers/main.php on lines 295..317

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

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

                if (!empty($user_email)) {
                    $match = (!empty($user_email_match)) ? (int) $user_email_match : XOOPS_MATCH_START;
                    switch ($match) {
                        case XOOPS_MATCH_START:
                            $criteria->add(new icms_db_criteria_Item('email', icms_core_DataFilter::addSlashes(trim($user_email)) . '%', 'LIKE'));
            Severity: Major
            Found in htdocs/modules/system/admin/findusers/main.php and 5 other locations - About 7 hrs to fix
            htdocs/modules/system/admin/findusers/main.php on lines 176..198
            htdocs/modules/system/admin/findusers/main.php on lines 199..221
            htdocs/modules/system/admin/findusers/main.php on lines 222..244
            htdocs/modules/system/admin/findusers/main.php on lines 295..317
            htdocs/modules/system/admin/findusers/main.php on lines 318..340

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

            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