xoopscube/altsys

View on GitHub

Showing 162 of 162 total issues

Function altsys_oninstall_base has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

        function altsys_oninstall_base( $module, $mydirname ) {
            $pieces = null;
   // transactions on module install

            global $ret; // TODO :-D
Severity: Minor
Found in xoops_trust_path/libs/altsys/oninstall.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

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

<?php

define( '_MYLANGADMIN_H3_MODULE' , 'Module cible');
define( '_MYLANGADMIN_CACHEUPDATED' , 'Le fichier de cache a été mis à jour');
define( '_MYLANGADMIN_BTN_UPDATE' , 'Mise à jour');
xoops_trust_path/libs/altsys/language/english/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/ja_utf8/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/pt_utf8/mylangadmin.php on lines 1..23
xoops_trust_path/libs/altsys/language/ru_utf8/mylangadmin.php on lines 1..27

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

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

<?php

define( '_MYLANGADMIN_H3_MODULE' , '言語定数操作対象モジュール');
define( '_MYLANGADMIN_CACHEUPDATED' , '言語キャッシュを更新しました');
define( '_MYLANGADMIN_BTN_UPDATE' , '更新');
xoops_trust_path/libs/altsys/language/english/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/fr_utf8/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/pt_utf8/mylangadmin.php on lines 1..23
xoops_trust_path/libs/altsys/language/ru_utf8/mylangadmin.php on lines 1..27

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

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

<?php

define( '_MYLANGADMIN_H3_MODULE' , 'Target module');
define( '_MYLANGADMIN_CACHEUPDATED' , 'The cache file has been updated');
define( '_MYLANGADMIN_BTN_UPDATE' , 'Update');
xoops_trust_path/libs/altsys/language/fr_utf8/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/ja_utf8/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/pt_utf8/mylangadmin.php on lines 1..23
xoops_trust_path/libs/altsys/language/ru_utf8/mylangadmin.php on lines 1..27

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

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

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

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

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

<?php

define( '_MYLANGADMIN_H3_MODULE' , 'Целевой модуль');
define( '_MYLANGADMIN_CACHEUPDATED' , 'Файл кеша обновлен!');
define( '_MYLANGADMIN_BTN_UPDATE' , 'Обновлять');
xoops_trust_path/libs/altsys/language/english/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/fr_utf8/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/ja_utf8/mylangadmin.php on lines 1..27
xoops_trust_path/libs/altsys/language/pt_utf8/mylangadmin.php on lines 1..23

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

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

    if ( $handler = @opendir( $tplsadmin_autoupdate_path . '/blocks/' ) ) {
        while ( false !== ( $file = readdir( $handler ) ) ) {
            $file_path = $tplsadmin_autoupdate_path . '/blocks/' . $file;
            if ( is_file( $file_path ) && '.html' == substr( $file, - 5 ) ) {
                $mtime = (int) @filemtime( $file_path );
xoops_trust_path/libs/altsys/include/autoupdate_from_module.inc.php on lines 30..47
xoops_trust_path/libs/altsys/include/autoupdate_from_theme.inc.php on lines 39..56
xoops_trust_path/libs/altsys/include/autoupdate_from_theme.inc.php on lines 59..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 244.

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

    if ( $handler = @opendir( $tplsadmin_autoupdate_path . '/blocks/' ) ) {
        while ( false !== ( $file = readdir( $handler ) ) ) {
            //$file_path = $tplsadmin_autoupdate_path . '/blocks/' . $file;
            $file_path = $tplsadmin_autoupdate_path . '/' . $file;
            if ( is_file( $file_path ) && '.html' == substr( $file, - 5 ) ) {
xoops_trust_path/libs/altsys/include/autoupdate_from_module.inc.php on lines 30..47
xoops_trust_path/libs/altsys/include/autoupdate_from_module.inc.php on lines 50..62
xoops_trust_path/libs/altsys/include/autoupdate_from_theme.inc.php on lines 39..56

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

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

    if ( $handler = @opendir( $tplsadmin_autoupdate_path . '/' ) ) {
        while ( false !== ( $file = readdir( $handler ) ) ) {
            $file_path = $tplsadmin_autoupdate_path . '/' . $file;
            /**
             * Import CSS
xoops_trust_path/libs/altsys/include/autoupdate_from_module.inc.php on lines 50..62
xoops_trust_path/libs/altsys/include/autoupdate_from_theme.inc.php on lines 39..56
xoops_trust_path/libs/altsys/include/autoupdate_from_theme.inc.php on lines 59..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 244.

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

    if ( $handler = @opendir( $tplsadmin_autoupdate_path . '/' ) ) {
        while ( false !== ( $file = readdir( $handler ) ) ) {
            $file_path = $tplsadmin_autoupdate_path . '/' . $file;
            /**
             * Import CSS
xoops_trust_path/libs/altsys/include/autoupdate_from_module.inc.php on lines 30..47
xoops_trust_path/libs/altsys/include/autoupdate_from_module.inc.php on lines 50..62
xoops_trust_path/libs/altsys/include/autoupdate_from_theme.inc.php on lines 59..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 244.

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

<?php
/**
 *  @brief XCL/PHP7 @gigamaster replace 'each' (deprecated) with foreach
 *
 * Text_Diff
Severity: Minor
Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 7 hrs to fix

    Function check has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

            public function check(bool $post = true, string $area = '', bool $allow_repost = true ) {
                global $xoopsModule;
    
                $this->_errors = [];
    
    
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/include/gtickets.php - About 6 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 _shiftBoundaries has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _shiftBoundaries( $lines, &$changed, $other_changed ) {
            $i = 0;
            $j = 0;
    
            assert( (is_countable($lines) ? count( $lines ) : 0) == count( $changed ) );
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/include/Text_Diff.php - About 6 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 _diag has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _diag( $xoff, $xlim, $yoff, $ylim, $nchunks ) {
            $ymatches = [];
      $ymids = [];
      $seps = [];
      $flip = false;
    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

    Function diff has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
    Open

        public function diff( $from_lines, $to_lines ) {
            $xhash = [];
      $yhash = [];
      $n_from = is_countable($from_lines) ? count( $from_lines ) : 0;
            $n_to   = is_countable($to_lines) ? count( $to_lines ) : 0;
    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

    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)
    {
        $ret = [];
        global $xoopsUser;
    
    
    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

    Function altsys_onupdate_base has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        function altsys_onupdate_base( $module, $mydirname ) {
            // transactions 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

    File mytplsadmin.php has 350 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Altsys library (UI-Components)
     * Admin Templates for each module
     * @package    Altsys
    Severity: Minor
    Found in xoops_trust_path/libs/altsys/mytplsadmin.php - About 4 hrs to fix

      Method b_altsys_admin_menu_show has 110 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function b_altsys_admin_menu_show($options)
      {
          $ret = [];
          global $xoopsUser;
      
      
      Severity: Major
      Found in xoops_trust_path/libs/altsys/blocks/block_functions.php - About 4 hrs to fix

        Function render has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public function render( $diff ) {
                $x0 = null;
          $y0 = null;
          $xi      = $yi = 1;
                $block   = false;
        Severity: Minor
        Found in xoops_trust_path/libs/altsys/include/Text_Diff_Renderer.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