xoopscube/altsys

View on GitHub

Showing 288 of 288 total issues

Archive_Zip has 43 functions (exceeds 20 allowed). Consider refactoring.
Open

class Archive_Zip
{
    /**
    * The filename of the zip archive.
    *
Severity: Minor
Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 5 hrs to fix

    Function _diag has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _diag($xoff, $xlim, $yoff, $ylim, $nchunks)
        {
            $flip = false;
    
            if ($xlim - $xoff > $ylim - $yoff) {
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 5 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

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

        return "
                    <div class='blockposition $scol0'>
                        <input type='radio' name='sides[$bid]' value='".XOOPS_SIDEBLOCK_LEFT."' class='blockposition' $ssel0 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_SIDEBLOCK_LEFT.";' />
                    </div>
                    <div style='float:"._GLOBAL_LEFT.";'>-</div>
    Severity: Major
    Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php and 1 other location - About 5 hrs to fix
    xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php on lines 89..123

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

    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

        return "
        <table  cellspacing='0' style='table-layout: fixed; width: 200px; '>
            <tr>
                <td rowspan='2'>
                    <div class='blockposition $scol0'>
    xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php on lines 338..358

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

    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

        public function _loadLanguage($dirname, $fileBodyName)
        {
            // read/check once (selected_theme)/language/(lang).php
            if (! $this->theme_lang_checked) {
                $root =& XCube_Root::getSingleton() ;
    html/preload/SetupAltsysLangMgr.class.php on lines 50..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 186.

    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

        public function _loadLanguage($dirname, $fileBodyName)
        {
            // read/check once (selected_theme)/language/(lang).php
            if (! $this->theme_lang_checked) {
                $root =& XCube_Root::getSingleton() ;
    Severity: Major
    Found in html/preload/SetupAltsysLangMgr.class.php and 1 other location - About 5 hrs to fix
    xoops_trust_path/libs/altsys/class/SetupAltsysLangMgr.class.php on lines 50..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 186.

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

        public function diff($from_lines, $to_lines)
        {
            $n_from = count($from_lines);
            $n_to = count($to_lines);
    
    
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 5 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

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

          elseif ((isset($p_params[ARCHIVE_ZIP_PARAM_BY_INDEX]))
                   && ($p_params[ARCHIVE_ZIP_PARAM_BY_INDEX] != 0)) {
    
              // ----- Look if the index is in the list
              for ($j=$j_start;
    Severity: Major
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php and 1 other location - About 5 hrs to fix
    xoops_trust_path/libs/altsys/include/Archive_Zip.php on lines 1843..1859

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

    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

          elseif ((isset($p_params[ARCHIVE_ZIP_PARAM_BY_INDEX]))
                   && ($p_params[ARCHIVE_ZIP_PARAM_BY_INDEX] != 0)) {
    
              // ----- Look if the index is in the list
              for ($j=$j_start; ($j<sizeof($p_params[ARCHIVE_ZIP_PARAM_BY_INDEX])) && (!$v_extract); $j++) {
    Severity: Major
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php and 1 other location - About 5 hrs to fix
    xoops_trust_path/libs/altsys/include/Archive_Zip.php on lines 2684..2704

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

    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 ($p_header['mdate'] && $p_header['mtime']) {
            // ----- Extract time
          $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
            $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
            $v_seconde = ($p_header['mtime'] & 0x001F)*2;
    Severity: Major
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php and 1 other location - About 4 hrs to fix
    xoops_trust_path/libs/altsys/include/Archive_Zip.php on lines 2295..2310

    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

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

          if ($p_header['mdate'] && $p_header['mtime']) {
              // ----- Extract time
          $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
              $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
              $v_seconde = ($p_header['mtime'] & 0x001F)*2;
    Severity: Major
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php and 1 other location - About 4 hrs to fix
    xoops_trust_path/libs/altsys/include/Archive_Zip.php on lines 2401..2416

    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

    Method _addFile has 123 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_params)
      {
          $v_result=1;
    
          if ($p_filename == "") {
    Severity: Major
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 4 hrs to fix

      Function _addFileList has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

        public function _addFileList($p_list, &$p_result_list,
                              $p_add_dir, $p_remove_dir, $p_remove_all_dir,
                              &$p_params)
        {
            $v_result=1;
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 4 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 b_altsys_admin_menu_show has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

      function b_altsys_admin_menu_show($options)
      {
          global $xoopsUser ;
      
          $mydirname = empty($options[0]) ? 'altsys' : $options[0] ;
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/blocks/block_functions.php - About 4 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

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

          $block_data = $this->preview_request + array(
              'bid' => $bid ,
              'name' => $block->getVar('name', 'n') ,
              'title' => $block->getVar('title', 'n') ,
              'weight' => intval($block->getVar('weight')) ,
      xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php on lines 897..912

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

      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

          $block_data = $this->preview_request + array(
              'bid' => $bid ,
              'name' => $block->getVar('name', 'n') ,
              'title' => $block->getVar('title', 'n') ,
              'weight' => intval($block->getVar('weight')) ,
      Severity: Major
      Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php and 1 other location - About 4 hrs to fix
      xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php on lines 212..227

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

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

        public function _extractByRule(&$p_file_list, &$p_params)
        {
            $v_result=1;
      
            $p_path = $p_params['add_path'];
      Severity: Major
      Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 4 hrs to fix

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

                switch ($mode) {
                case 'clone' :
                    $form_title = _MD_A_MYBLOCKSADMIN_CLONEFORM ;
                    $button_value = _MD_A_MYBLOCKSADMIN_BTN_CLONE ;
                    $next_op = 'clone_ok' ;
        xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php on lines 853..879

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

        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

                switch ($mode) {
                case 'clone' :
                    $form_title = _MD_A_MYBLOCKSADMIN_CLONEFORM ;
                    $button_value = _MD_A_MYBLOCKSADMIN_BTN_CLONE ;
                    $next_op = 'clone_ok' ;
        Severity: Major
        Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php and 1 other location - About 4 hrs to fix
        xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php on lines 168..194

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

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

            function altsys_onupdate_base($module, $mydirname)
            {
                // transations on module update
        
            global $msgs ; // TODO :-D
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/onupdate.php - About 4 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