xoopscube/altsys

View on GitHub

Showing 242 of 242 total issues

Function altsys_mylangadmin_get_constant_names has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function altsys_mylangadmin_get_constant_names( $langfile_unique_path, $mydirname ) {

    $constpref = '';

    $langfile_names = [];
Severity: Minor
Found in xoops_trust_path/libs/altsys/include/lang_functions.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 _add has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  public function _add($p_list, &$p_result_list, &$p_params)
  {
      $v_result=1;
      $v_list_detail = [];

Severity: Minor
Found in xoops_trust_path/libs/altsys/include/Archive_Zip.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 _addFileList has 47 lines of code (exceeds 25 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 1 hr to fix

    Method _readCentralFileHeader has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      public function _readCentralFileHeader(&$p_header)
      {
          $v_result=1;
    
        // ----- Read the 4 bytes signature
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 hr to fix

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

      <?php
      
      define( '_MD_A_MYTPLSFORM_TPLSADMIN' , 'テンプレート管理');
      define( '_MD_A_MYTPLSFORM_EDIT' , 'テンプレート編集');
      define( '_MD_A_MYTPLSFORM_UPDATED' , 'テンプレートを更新しました');
      xoops_trust_path/libs/altsys/language/english/mytplsform.php on lines 1..11
      xoops_trust_path/libs/altsys/language/fr_utf8/mytplsform.php on lines 1..11
      xoops_trust_path/libs/altsys/language/pt_utf8/mytplsform.php on lines 1..13

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

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

      <?php
      
      define( '_MD_A_MYTPLSFORM_TPLSADMIN' , 'Templates');
      define( '_MD_A_MYTPLSFORM_EDIT' , 'Editing the template');
      define( '_MD_A_MYTPLSFORM_UPDATED' , 'The template is updated successfully');
      xoops_trust_path/libs/altsys/language/fr_utf8/mytplsform.php on lines 1..11
      xoops_trust_path/libs/altsys/language/ja_utf8/mytplsform.php on lines 1..11
      xoops_trust_path/libs/altsys/language/pt_utf8/mytplsform.php on lines 1..13

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

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

      <?php
      
      define( '_MD_A_MYTPLSFORM_TPLSADMIN' , 'Templates');
      define( '_MD_A_MYTPLSFORM_EDIT' , 'Edition du template');
      define( '_MD_A_MYTPLSFORM_UPDATED' , 'Mise à jour avec succés du template');
      xoops_trust_path/libs/altsys/language/english/mytplsform.php on lines 1..11
      xoops_trust_path/libs/altsys/language/ja_utf8/mytplsform.php on lines 1..11
      xoops_trust_path/libs/altsys/language/pt_utf8/mytplsform.php on lines 1..13

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

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

      <?php
      
      // $Id: mytplsform.php 1040 2011-11-06 05:24:00Z mikhail $
      // License http://creativecommons.org/licenses/by/2.5/br/
      define( '_MD_A_MYTPLSFORM_TPLSADMIN' , "Modelos");
      xoops_trust_path/libs/altsys/language/english/mytplsform.php on lines 1..11
      xoops_trust_path/libs/altsys/language/fr_utf8/mytplsform.php on lines 1..11
      xoops_trust_path/libs/altsys/language/ja_utf8/mytplsform.php on lines 1..11

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

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

          public function render( $diff ) {
              $xi      = $yi = 1;
              $block   = false;
              $context = [];
      
      
      Severity: Minor
      Found in xoops_trust_path/libs/altsys/include/Text_Diff_Renderer.php - About 1 hr to fix

        Function tplsadmin_get_basefilepath has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function tplsadmin_get_basefilepath( $dirname, $type, $tpl_file ) {
            // module instance
        
            $path = $basefilepath = XOOPS_ROOT_PATH . '/modules/' . $dirname . '/templates/' . ( 'block' == $type ? 'blocks/' : '' ) . $tpl_file;
        
        
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/tpls_functions.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 extract_post_recursive has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

                public function extract_post_recursive( $key_name, $tmp_array ) {
                    $table = '';
        
                    $form = '';
        
        
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/gtickets.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 altsys_admin_in_theme_in_last has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function altsys_admin_in_theme_in_last( $contents = null ) {
            global $xoops_admin_contents, $xoopsConfig, $xoopsModule, $xoopsUser, $xoopsUserIsAdmin, $xoopsLogger, $altsysModuleConfig, $altsysModuleId;
        
            if ( ! isset( $contents ) ) {
                while ( ob_get_level() ) {
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/admin_in_theme_functions.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 _check_parameters has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          public function _check_parameters(&$p_params, $p_default)
          {
        
            // ----- Check that param is an array
            if (!is_array($p_params)) {
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/Archive_Zip.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 _compareseq has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            public function _compareseq( $xoff, $xlim, $yoff, $ylim ) {
                /* Slide down the bottom initial diagonal. */
                while ( $xoff < $xlim && $yoff < $ylim
                        && $this->xv[ $xoff ] == $this->yv[ $yoff ] ) {
                    ++ $xoff;
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/Text_Diff.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

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

                    XCube_DelegateUtils::call(
                    'D3NotificationHandler.Trigger',
                    new XCube_Ref($category),
                    new XCube_Ref($event),
                    new XCube_Ref($item_id),
        xoops_trust_path/libs/altsys/class/D3NotificationHandler.class.php on lines 96..110

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

        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

                        XCube_DelegateUtils::call(
                        'D3NotificationHandler.Trigger',
                        new XCube_Ref($category),
                        new XCube_Ref($event),
                        new XCube_Ref($item_id),
        xoops_trust_path/libs/altsys/class/D3NotificationHandler.class.php on lines 129..142

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

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

          public function _readFileHeader(&$p_header)
          {
              $v_result=1;
        
            // ----- Read the 4 bytes signature
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/Archive_Zip.php - About 1 hr to fix

          Method tplsadmin_copy_templates_db2db has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function tplsadmin_copy_templates_db2db( $tplset_from, $tplset_to, $whr_append = '1' ) {
              global $db;
          
              // get tplfile and tplsource
          
          
          Severity: Minor
          Found in xoops_trust_path/libs/altsys/include/tpls_functions.php - About 1 hr to fix

            Method do_clone has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function do_clone( $bid ) {
                    $bid = (int) $bid;
            
                    $request = $this->fetchRequest4Block( $bid );
            
            
            Severity: Minor
            Found in xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php - About 1 hr to fix

              Method draw_repost_form has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public function draw_repost_form(string $area = '' ) {
                          // Notify which file is broken
              
                          if ( headers_sent() ) {
                              restore_error_handler();
              Severity: Minor
              Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language