xoopscube/altsys

View on GitHub
xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php

Summary

Maintainability
F
4 days
Test Coverage

Method renderCell4BlockPosition has 111 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public function renderCell4BlockPosition($block_data)
{
    $bid = intval($block_data['bid']) ;
    $side = intval($block_data['side']) ;
    $visible = intval($block_data['visible']) ;
Severity: Major
Found in xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php - About 4 hrs to fix

    Method form_edit has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function form_edit($bid, $mode = 'edit')
        {
            $bid = intval($bid) ;
    
    //HACK by domifara
    Severity: Major
    Found in xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php - About 4 hrs to fix

      File MyBlocksAdminForX25.class.php has 306 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      require_once dirname(__FILE__).'/MyBlocksAdmin.class.php' ;
      
      class MyBlocksAdminForX25 extends MyBlocksAdmin
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php - About 3 hrs to fix

        Function renderCell4BlockPosition has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        public function renderCell4BlockPosition($block_data)
        {
            $bid = intval($block_data['bid']) ;
            $side = intval($block_data['side']) ;
            $visible = intval($block_data['visible']) ;
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php - About 1 hr 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

        Method previewContent has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function previewContent($block_data)
            {
                $bid = intval($block_data['bid']) ;
        
                if (! $block_data['is_custom']) {
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php - About 1 hr to fix

          Function form_edit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function form_edit($bid, $mode = 'edit')
              {
                  $bid = intval($bid) ;
          
          //HACK by domifara
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php - About 1 hr 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 previewContent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function previewContent($block_data)
              {
                  $bid = intval($block_data['bid']) ;
          
                  if (! $block_data['is_custom']) {
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php - About 45 mins 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 "
              <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

              $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

                  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

                  if (! $is_custom && $block_template) {
                      // find template of the block
                  $tplfile_handler =& xoops_gethandler('tplfile');
                      $found_templates = $tplfile_handler->find($GLOBALS['xoopsConfig']['template_set'], 'block', null, null, $block_template) ;
                      $block_template_tplset = count($found_templates) > 0 ? $GLOBALS['xoopsConfig']['template_set'] : 'default' ;
          xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php on lines 885..890

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

          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

                  $block4assign = array(
                  'name_raw' => $block_data['name'] ,
                  'title_raw' => $block_data['title'] ,
                  'content_raw' => $block_data['content'] ,
                  'cell_position' => $this->renderCell4BlockPosition($block_data) ,
          xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php on lines 914..923

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

          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 ($c_type == 'S') {
                      (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
                      $content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N'));
                      $ret = $myts->displayTarea($content, 1, 1);
                  } else {
          xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php on lines 354..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 93.

          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

                  } else {
                      (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts =& MyTextSanitizer::getInstance();
                      $content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N'));
                      $ret = $myts->displayTarea($content, 1, 0);
                  }
          xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php on lines 350..354

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

          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

          There are no issues that match your filters.

          Category
          Status