mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

                if ($v_extract_file && ('5' != $v_header['typeflag'])) {
                    // ----- Open the destination file in write mode
                    if (0 == ($v_dest_file = @fopen($v_header['filename'], 'wb'))) {
                        TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening ' . $v_header['filename'] . ' in write binary mode');

Severity: Major
Found in class/pcltar.lib.php and 1 other location - About 3 hrs to fix
class/pcltar.lib.php on lines 2631..2702

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

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 ($v_extract_file && ('5' != $v_header['typeflag'])) {
            // ----- Open the destination file in write mode
            if (0 == ($v_dest_file = @fopen($v_header['filename'], 'wb'))) {
                TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening ' . $v_header['filename'] . ' in write binary mode');

Severity: Major
Found in class/pcltar.lib.php and 1 other location - About 3 hrs to fix
class/pcltar.lib.php on lines 2125..2203

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

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

Function init has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        init : function() {

            if ( lightbox.initialized ) {
                return;
            }
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js - About 3 hrs to fix

    Function getAll has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function &getAll(CriteriaElement $criteria = null, $fields = null, $asObject = true, $id_as_key = true)
        {
            if ($fields && \is_array($fields)) {
                if (!\in_array($this->handler->keyName, $fields)) {
                    $fields[] = $this->handler->keyName;
    Severity: Minor
    Found in class/ModelReadIterator.php - About 3 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 History has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Galleria.History = (function () {
    
            var onloads = [],
    
                init = false,
    Severity: Major
    Found in assets/js/galleria/plugins/history/galleria.history.js - About 3 hrs to fix

      Method fetchPhoto has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function fetchPhoto($file)
          {
              $jupart  = Request::getInt('jupart', 0, 'POST');
              $jufinal = Request::getInt('jufinal', 1, 'POST');
              $md5sums = $_POST['md5sum'][0] ?? null;
      Severity: Major
      Found in class/PhotoUploader.php - About 3 hrs to fix

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

                if ((!is_file($p_tarname_add))
                    || ((0 != (($v_size_add = filesize($p_tarname_add)) % 512))
                        && ('tar' === $p_mode_add))) {
                    // ----- Error log
                    if (!is_file($p_tarname_add)) {
        Severity: Major
        Found in class/pcltar.lib.php and 2 other locations - About 3 hrs to fix
        class/pcltar.lib.php on lines 810..822
        class/pcltar.lib.php on lines 1188..1200

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

        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 (!gzeof($p_tar)) {
                        TrFctMessage(__FILE__, __LINE__, 3, 'More than one 512 block file');
                        $i = 1;
        
                        // ----- Read new 512 block and write the already read
        Severity: Major
        Found in class/pcltar.lib.php and 1 other location - About 3 hrs to fix
        class/pcltar.lib.php on lines 872..890

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

        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 ((!is_file($p_tarname)) || ((0 != (($v_size = filesize($p_tarname)) % 512)) && ('tar' === $p_mode))) {
                    // ----- Error log
                    if (!is_file($p_tarname)) {
                        PclErrorLog(-4, "Archive '$p_tarname' does not exist");
                    } else {
        Severity: Major
        Found in class/pcltar.lib.php and 2 other locations - About 3 hrs to fix
        class/pcltar.lib.php on lines 823..837
        class/pcltar.lib.php on lines 1188..1200

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

        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 ((!is_file($p_tarname)) || ((0 != (($v_size = filesize($p_tarname)) % 512)) && ('tar' === $p_mode))) {
                    // ----- Error log
                    if (!is_file($p_tarname)) {
                        PclErrorLog(-4, "Archive '$p_tarname' does not exist");
                    } else {
        Severity: Major
        Found in class/pcltar.lib.php and 2 other locations - About 3 hrs to fix
        class/pcltar.lib.php on lines 810..822
        class/pcltar.lib.php on lines 823..837

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

        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 (!gzeof($p_tar)) {
                        TrFctMessage(__FILE__, __LINE__, 3, 'More than one 512 block file');
                        $i = 1;
        
                        // ----- Read new 512 block and write the already read
        Severity: Major
        Found in class/pcltar.lib.php and 1 other location - About 3 hrs to fix
        class/pcltar.lib.php on lines 1235..1253

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

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

                                    if(old_i != i) {
                                        j_frames.eq(old_i).removeClass('current').find('img').css({
                                            'opacity':opts.frame_opacity
                                        });
                                        j_frames.eq(i).addClass('current').find('img').css({
        Severity: Major
        Found in assets/js/galleryview/galleryview.js and 1 other location - About 3 hrs to fix
        assets/js/galleryview/galleryview.js on lines 140..147

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

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

                                    if(old_i != i) {
                                        j_frames.eq(old_i).removeClass('current').find('img').css({
                                            'opacity':opts.frame_opacity
                                        });
                                        j_frames.eq(i).addClass('current').find('img').css({
        Severity: Major
        Found in assets/js/galleryview/galleryview.js and 1 other location - About 3 hrs to fix
        assets/js/galleryview/galleryview.js on lines 183..190

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

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

                        navPrev.css({
                            'left':(opts.filmstrip_position=='left'?Math.max(gallery_padding,filmstrip_margin):opts.panel_width+filmstrip_margin+gallery_padding)+((f_frame_width-22)/2)-13+'px',
                            'top':wrapper_height+(Math.max(gallery_padding,opts.frame_gap)*2)+'px'
                        });
        Severity: Major
        Found in assets/js/galleryview/galleryview.js and 1 other location - About 3 hrs to fix
        assets/js/galleryview/galleryview.js on lines 681..684

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

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

                        navNext.css({
                            'left':(opts.filmstrip_position=='left'?Math.max(gallery_padding,filmstrip_margin):opts.panel_width+filmstrip_margin+gallery_padding)+((f_frame_width-22)/2)+13+'px',
                            'top':wrapper_height+(Math.max(gallery_padding,opts.frame_gap)*2)+'px'
                        });
        Severity: Major
        Found in assets/js/galleryview/galleryview.js and 1 other location - About 3 hrs to fix
        assets/js/galleryview/galleryview.js on lines 685..688

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

        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

        The class Parsedown has an overall complexity of 151 which is very high. The configured complexity threshold is 50.
        Open

        class Parsedown
        {
            #
            # Multiton (http://en.wikipedia.org/wiki/Multiton_pattern)
            #

        The class MetaSlider has an overall complexity of 72 which is very high. The configured complexity threshold is 50.
        Open

        class MetaSlider
        {
            public $id         = 0; // slider ID
            public $identifier = 0; // unique identifier
            public $slides     = []; //slides belonging to this slider

        The class MetaSliderPlugin has an overall complexity of 123 which is very high. The configured complexity threshold is 50.
        Open

        class MetaSliderPlugin
        {
            /** Current Slider **/
            public $slider = null;
        
        
        Severity: Minor
        Found in assets/js/ml-slider/ml-slider.php by phpmd

        The class MetaSliderPlugin has 28 non-getter- and setter-methods. Consider refactoring MetaSliderPlugin to keep number of methods under 25.
        Open

        class MetaSliderPlugin
        {
            /** Current Slider **/
            public $slider = null;
        
        
        Severity: Minor
        Found in assets/js/ml-slider/ml-slider.php by phpmd

        TooManyMethods

        Since: 0.1

        A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        The default was changed from 10 to 25 in PHPMD 2.3.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanymethods

        The class MetaSliderPlugin has 21 public methods. Consider refactoring MetaSliderPlugin to keep number of public methods under 10.
        Open

        class MetaSliderPlugin
        {
            /** Current Slider **/
            public $slider = null;
        
        
        Severity: Minor
        Found in assets/js/ml-slider/ml-slider.php by phpmd

        TooManyPublicMethods

        Since: 0.1

        A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

        By default it ignores methods starting with 'get' or 'set'.

        Example

        Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

        Severity
        Category
        Status
        Source
        Language