mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

Function compareVersion has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function compareVersion($v1, $v2)
{
    $v1 = explode('.', $v1);
    $v2 = explode('.', $v2);

Severity: Minor
Found in admin/moduleUpdateFunction.php - About 55 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 rcopy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function rcopy($src, $dest)
    {
        // Only continue if user is a 'global' Admin
        if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
            return false;
Severity: Minor
Found in class/Common/FilesManagement.php - About 55 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 populate_slides has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function populate_slides()
    {
        $slides = [];

        $query = $this->get_slides();
Severity: Minor
Found in assets/js/ml-slider/inc/slider/metaslider.class.php - About 55 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 PclTarList has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function PclTarList($p_tarname, $p_mode = '')
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarList', "tar=$p_tarname, mode='$p_mode'");
        $v_result = 1;

Severity: Minor
Found in class/pcltar.lib.php - About 55 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 rmove has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function rmove($src, $dest)
    {
        // Only continue if user is a 'global' Admin
        if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
            return false;
Severity: Minor
Found in class/Common/FilesManagement.php - About 55 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 PclTarExtract has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    function PclTarExtract($p_tarname, $p_path = './', $p_remove_path = '', $p_mode = '')
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarExtract', "tar='$p_tarname', path='$p_path', remove_path='$p_remove_path', mode='$p_mode'");
        $v_result = 1;

Severity: Minor
Found in class/pcltar.lib.php - About 55 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 getSearchedPhoto has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSearchedPhoto($queryArray, $condition, $limit, $start, $userId)
    {
        $criteria = new CriteriaCompo();
        if ($userId > 0) {
            $criteria->add(new Criteria('uid', $userId));
Severity: Minor
Found in class/PhotoHandler.php - About 55 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 getBlockSelect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBlockSelect($selected = [])
    {
        $cats           = $this->getDescendants();
        $ret            = '<select name="options[]" multiple="multiple">';
        $selectedOption = '';
Severity: Minor
Found in class/CategoryHandler.php - About 55 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function render()
    {
        $ele_name = $this->getName();
        echo '<table class="outer"><tr><td class="odd"><table><tr>';
        $cols = 1;
Severity: Minor
Found in class/GroupFormCheckBox.php - About 55 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

        Utils.hide( this.$( 'counter' ).append(
            this.get( 'current' ),
            doc.createTextNode(' / '),
            this.get( 'total' )
        ) );
Severity: Minor
Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 55 mins to fix
assets/js/galleria/galleria-1.3.5.js on lines 2823..2827

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

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

        Utils.hide( this.$( 'counter' ).append(
            this.get( 'current' ),
            doc.createTextNode(' / '),
            this.get( 'total' )
        ) );
Severity: Minor
Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 55 mins to fix
assets/js/galleria/galleria-1.3.3.js on lines 2809..2813

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

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 (class_exists('seo42')) {
            $imageManagerUrl = seo42::getImageManagerUrl($imageFile, $imageType);
        } else {
            if ($REX['REDAXO']) {
                $imageManagerUrl = $REX['HTDOCS_PATH'] . 'redaxo/index.php?rex_img_type=' . $imageType . '&amp;rex_img_file=' . $imageFile;
assets/js/magnific_popup/redaxo/magnific_popup/module/image/output.php on lines 30..38

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

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 (class_exists('seo42')) {
        $imageManagerUrl = seo42::getImageManagerUrl($imageFile, $imageType);
    } else {
        if ($REX['REDAXO']) {
            $imageManagerUrl = $REX['HTDOCS_PATH'] . 'redaxo/index.php?rex_img_type=' . $imageType . '&amp;rex_img_file=' . $imageFile;
assets/js/magnific_popup/redaxo/magnific_popup/module/gallery/output.php on lines 37..45

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

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

        $p_tarname,
        $p_file_list,
        &$p_list_detail,
        $p_mode,
        $p_path,
Severity: Major
Found in class/pcltar.lib.php - About 50 mins to fix

    Method isBlockCloned has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
    Severity: Major
    Found in admin/blocksadmin.php - About 50 mins to fix

      Method makeSelect has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function makeSelect($cats, $name, $selectMode, $addEmpty, $selected, $extra, $displayWeight)
      Severity: Major
      Found in class/CategoryHandler.php - About 50 mins to fix

        Method getSelect has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $name,
                $selectMode,
                $addEmpty = false,
                $selected = 0,
                $extra = '',
        Severity: Major
        Found in class/CategoryHandler.php - About 50 mins to fix

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

              if ($('#magnific_type').val() == 'single' && $('#singleOption').val() == 'select-2') {
                  ccm_addError(ccm_t('single-option-required'));
              }
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 61..63
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 67..69
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 70..72
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 73..75
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 76..78
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 79..81
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 82..84

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

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

              next : function() {
                  if ( this.getDataLength() > 1 ) {
                      this.show( this.getNext(), false );
                  }
                  return this;
          Severity: Major
          Found in assets/js/galleria/galleria-1.1.js and 5 other locations - About 50 mins to fix
          assets/js/galleria/galleria-1.1.js on lines 2854..2859
          assets/js/galleria/galleria-1.3.3.js on lines 5169..5174
          assets/js/galleria/galleria-1.3.3.js on lines 5182..5187
          assets/js/galleria/galleria-1.3.5.js on lines 5190..5195
          assets/js/galleria/galleria-1.3.5.js on lines 5203..5208

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

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

              if ($('#magnific_type').val() == 'vidMap' && $('#videoOptions').val() == 'select-3') {
                  ccm_addError(ccm_t('video-map-selection-required'));
              }
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 58..60
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 61..63
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 70..72
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 73..75
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 76..78
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 79..81
          assets/js/magnific_popup/concrete5/magnific_popup/blocks/magnific_popup/auto.js on lines 82..84

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

          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