mambax7/publisher

View on GitHub

Showing 3,032 of 3,032 total issues

Avoid excessively long variable names like $text_meta_description. Keep variable name length under 20.
Open

            $text_meta_description = new \XoopsFormTextArea(\_CO_PUBLISHER_ITEM_META_DESCRIPTION, 'item_meta_description', $obj->meta_description('e'), 7, 60);
Severity: Minor
Found in class/Form/ItemForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $selectAllModerateCheckbox. Keep variable name length under 20.
Open

        $selectAllModerateCheckbox = new \XoopsFormCheckBox('', 'adminbox3', 1);
Severity: Minor
Found in class/Form/CategoryForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $submitPermissionsTray. Keep variable name length under 20.
Open

        $submitPermissionsTray = new \XoopsFormElementTray(\_AM_PUBLISHER_PERMISSIONS_CAT_SUBMIT, '');
Severity: Minor
Found in class/Form/CategoryForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $moderatePermissionsTray. Keep variable name length under 20.
Open

        $moderatePermissionsTray = new \XoopsFormElementTray(\_AM_PUBLISHER_PERMISSIONS_CAT_MODERATOR, '');
Severity: Minor
Found in class/Form/CategoryForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $selectAllReadCheckbox. Keep variable name length under 20.
Open

        $selectAllReadCheckbox = new \XoopsFormCheckBox('', 'adminbox', 1);
Severity: Minor
Found in class/Form/CategoryForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $availableItemTemplates. Keep variable name length under 20.
Open

        $availableItemTemplates = [];
Severity: Minor
Found in class/Form/CategoryForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $groupsModerationCheckbox. Keep variable name length under 20.
Open

        $groupsModerationCheckbox = new \XoopsFormCheckBox('', 'groupsModeration[]', $this->targetObject->getGroupsModeration());
Severity: Minor
Found in class/Form/CategoryForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $selectAllSubmitCheckbox. Keep variable name length under 20.
Open

        $selectAllSubmitCheckbox = new \XoopsFormCheckBox('', 'adminbox2', 1);
Severity: Minor
Found in class/Form/CategoryForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $availableWrapPagesText. Keep variable name length under 20.
Open

            $availableWrapPagesText = [];
Severity: Minor
Found in class/Form/ItemForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Function _getResponse has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        _getResponse: function (iframe, file) {
            // getting response
            var toDeleteFlag = false, self = this, settings = this._settings;

            addEvent(iframe, 'load', function () {
Severity: Minor
Found in assets/js/ajaxupload.3.9.js - About 1 hr to fix

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

        public function updateBlock(int $bid, string $btitle, string $bside, string $bweight, string $bvisible, string $bcachetime, ?array $bmodule, ?array $options, ?array $groups): void
        {
            $myblock = new \XoopsBlock($bid);
            $myblock->setVar('title', $btitle);
            $myblock->setVar('weight', $bweight);
    Severity: Minor
    Found in class/Common/Blocksadmin.php - About 1 hr to fix

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

          public static function displayCategory(Category $categoryObj, $level = 0): void
          {
              $helper       = Helper::getInstance();
              $configurator = new Common\Configurator();
              $icons        = $configurator->icons;
      Severity: Minor
      Found in class/Utility.php - About 1 hr to fix

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

        if ($GLOBALS['xoopsDB']->getRowsNum($result_view)) {
            $form_submit = new \XoopsGroupPermForm(
                '', $helper->getModule()
                           ->mid(), 'item_submit', '', 'admin/permissions.php'
            );
        Severity: Major
        Found in admin/permissions.php and 2 other locations - About 1 hr to fix
        admin/permissions.php on lines 39..50
        admin/permissions.php on lines 75..86

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

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

        if ($GLOBALS['xoopsDB']->getRowsNum($result_view)) {
            $form_submit = new \XoopsGroupPermForm(
                '', $helper->getModule()
                           ->mid(), 'category_read', '', 'admin/permissions.php'
            );
        Severity: Major
        Found in admin/permissions.php and 2 other locations - About 1 hr to fix
        admin/permissions.php on lines 57..68
        admin/permissions.php on lines 75..86

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

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

        if ($GLOBALS['xoopsDB']->getRowsNum($result_view)) {
            $form_submit = new \XoopsGroupPermForm(
                '', $helper->getModule()
                           ->mid(), 'category_moderation', '', 'admin/permissions.php'
            );
        Severity: Major
        Found in admin/permissions.php and 2 other locations - About 1 hr to fix
        admin/permissions.php on lines 39..50
        admin/permissions.php on lines 57..68

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

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

            public static function createDir(): void
            {
                // auto crate folders
                //        $thePath = static::getUploadDir();
        
        
        Severity: Minor
        Found in class/Utility.php - About 1 hr to fix

          Function loadTableFromArrayWithReplace has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          function loadTableFromArrayWithReplace($table, $data, $search, $replace)
          {
              /** @var \XoopsMySQLDatabase $db */
              $db = \XoopsDatabaseFactory::getDatabaseConnection();
          
          
          Severity: Minor
          Found in testdata/index.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 publisher_latest_news_edit has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

          function publisher_latest_news_edit($options)
          {
              $tabletag1 = '<tr><td style="padding:3px;" width="37%">';
              $tabletag2 = '</td><td style="padding:3px;">';
              $tabletag3 = '<tr><td style="padding-top:20px;border-bottom:1px solid #000;" colspan="2">';
          Severity: Minor
          Found in blocks/latest_news.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 tryBrowserCache has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function tryBrowserCache()
              {
                  if (BROWSER_CACHE_DISABLE) {
                      $this->debug(3, 'Browser caching is disabled');
          
          
          Severity: Minor
          Found in thumb.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 tryServerCache has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function tryServerCache()
              {
                  $this->debug(3, 'Trying server cache');
                  if (is_file($this->cachefile)) {
                      $this->debug(3, "Cachefile {$this->cachefile} exists");
          Severity: Minor
          Found in thumb.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

          Severity
          Category
          Status
          Source
          Language