XoopsModules25x/about

View on GitHub

Showing 434 of 434 total issues

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 13 and the first side effect is on line 7.
Open

<?php
Severity: Minor
Found in class/Tree.php by phpcodesniffer

The parameter $index_by_page is not named in camelCase.
Open

    public static function &template_lookup($index_by_page = false)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';

        $files = \XoopsLists::getHtmlListAsArray(XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['artdirname'] . '/templates/');
Severity: Minor
Found in class/Utility.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 24 and the first side effect is on line 21.
Open

<?php
Severity: Minor
Found in language/german/common.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 30 and the first side effect is on line 26.
Open

<?php
Severity: Minor
Found in blocks/blocks.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 19 and the first side effect is on line 10.
Open

<?php
Severity: Minor
Found in include/action.module.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 24 and the first side effect is on line 21.
Open

<?php
Severity: Minor
Found in language/english/common.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 51 and the first side effect is on line 26.
Open

<?php
Severity: Minor
Found in include/common.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 28 and the first side effect is on line 23.
Open

<?php
Severity: Minor
Found in class/BlockForm.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 39 and the first side effect is on line 31.
Open

<?php
Severity: Minor
Found in include/onupdate.php by phpcodesniffer

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 34 and the first side effect is on line 33.
Open

<?php
Severity: Minor
Found in class/Utility.php by phpcodesniffer

Avoid deeply nested control flow statements.
Open

                    if ($pageObj->getVar('page_image')) {
                        @unlink($upload_path . '/' . $pageObj->getVar('page_image'));
                    }
Severity: Major
Found in admin/admin.page.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if (is_file($templateFolder . $v)) {
                                    unlink($templateFolder . $v);
                                }
    Severity: Major
    Found in include/onupdate.php - About 45 mins to fix

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

          public function render()
          {
              $ret    = '<div>';
              $hidden = '';
              foreach ($this->getElements() as $ele) {
      Severity: Minor
      Found in class/BlockForm.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

      Function menuTree has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function menuTree(array $pages = [], $key = 0, $level = 1)
          {
              $ret = false;
              if (!\is_array($pages) || 0 === \count($pages)) {
                  return $ret;
      Severity: Minor
      Found in class/PageHandler.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

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

          'paths'          => [
              'dirname'    => $moduleDirName,
              'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
              'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
              'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
      Severity: Minor
      Found in config/config.php and 1 other location - About 45 mins to fix
      include/config.php on lines 35..42

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

      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

          'paths'         => [
              'dirname'    => $moduleDirName,
              'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
              'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
              'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
      Severity: Minor
      Found in include/config.php and 1 other location - About 45 mins to fix
      config/config.php on lines 28..35

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

      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 truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
      Severity: Minor
      Found in class/Common/SysUtility.php - About 35 mins to fix

        Method makeTreeItems has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                public function makeTreeItems($key, &$ret, $prefix_orig, $prefix_curr = '', $tags = null)
        Severity: Minor
        Found in class/Tree.php - About 35 mins to fix

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

          <?php
          
          /**
           * About
           *
          Severity: Minor
          Found in language/german/main.php and 1 other location - About 35 mins to fix
          language/english/main.php on lines 1..31

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

          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

          <?php
          
          /**
           * About
           *
          Severity: Minor
          Found in language/english/main.php and 1 other location - About 35 mins to fix
          language/german/main.php on lines 1..31

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Severity
          Category
          Status
          Source
          Language