mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

File xoops_version.php has 1259 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * ExtGallery XOOPS_VERSION
 *
 * You may not change or alter any portion of this comment or credits
Severity: Major
Found in xoops_version.php - About 3 days to fix

    Function parse_block_elements has a Cognitive Complexity of 154 (exceeds 5 allowed). Consider refactoring.
    Open

        private function parse_block_elements(array $lines, $context = '')
        {
            $elements = [];
    
            $element = [

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

        $.fn.galleriffic = function(settings) {
            //  Extend Gallery Object
            $.extend(this, {
                // Returns the version of the script
                version: $.galleriffic.version,
    Severity: Major
    Found in assets/js/galleriffic/jquery.galleriffic.js - About 2 days to fix

      File jquery.tosrus.js has 1128 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       *  jQuery Touch Optimized Sliders "R"Us 1.4.0
       *
       *  Copyright (c) 2013 Fred Heusschen
       *  www.frebsite.nl
      Severity: Major
      Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 2 days to fix

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

            _scaleImage : function( image, options ) {
        
                image = image || this._controls.getActive();
        
                // janpub (JH) fix:
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 2 days to fix
        assets/js/galleria/galleria-1.3.3.js on lines 4555..4606

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

        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

            _scaleImage : function( image, options ) {
        
                image = image || this._controls.getActive();
        
                // janpub (JH) fix:
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 2 days to fix
        assets/js/galleria/galleria-1.3.5.js on lines 4573..4624

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

        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

        Galleria.addTheme = function( theme ) {
        
            // make sure we have a name
            if ( !theme.name ) {
                Galleria.raise('No theme name specified');
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 2 days to fix
        assets/js/galleria/galleria-1.3.5.js on lines 5608..5689

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

        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

        Galleria.addTheme = function( theme ) {
        
            // make sure we have a name
            if ( !theme.name ) {
                Galleria.raise('No theme name specified');
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 2 days to fix
        assets/js/galleria/galleria-1.3.3.js on lines 5587..5668

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

        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

                    this.bind( Galleria.IMAGE, function(e) {
        
                        self.setCounter( e.index );
                        self.setInfo( e.index );
        
        
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 2 days to fix
        assets/js/galleria/galleria-1.3.5.js on lines 2976..3024

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

        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

                    this.bind( Galleria.IMAGE, function(e) {
        
                        self.setCounter( e.index );
                        self.setInfo( e.index );
        
        
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 2 days to fix
        assets/js/galleria/galleria-1.3.3.js on lines 2958..3006

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

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

            public function render_admin_page()
            {
                $this->admin_process();
                $this->go_pro_cta();
                $this->system_check();
        Severity: Major
        Found in assets/js/ml-slider/ml-slider.php - About 2 days to fix

          File ml-slider.php has 1047 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*
           * Plugin Name: Meta Slider
           * Plugin URI: http://www.metaslider.com
           * Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
          Severity: Major
          Found in assets/js/ml-slider/ml-slider.php - About 2 days to fix

            Function PclTarHandleUpdate has a Cognitive Complexity of 130 (exceeds 5 allowed). Consider refactoring.
            Open

                function PclTarHandleUpdate($p_tarname, $p_file_list, &$p_list_detail, $p_tar_mode, $p_add_dir, $p_remove_dir)
                {
                    TrFctStart(__FILE__, __LINE__, 'PclTarHandleUpdate', "archive='$p_tarname', list, tar_mode=$p_tar_mode");
                    $v_result     = 1;
                    $v_nb         = 0;
            Severity: Minor
            Found in class/pcltar.lib.php - About 2 days 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 2 locations. Consider refactoring.
            Open

            <?php
            $moduleInput  = rex_get_file_contents($REX['INCLUDE_PATH'] . '/addons/magnific_popup/module/gallery/input.php');
            $moduleOutput = rex_get_file_contents($REX['INCLUDE_PATH'] . '/addons/magnific_popup/module/gallery/output.php');
            
            // Ist Modul schon vorhanden ?
            assets/js/magnific_popup/redaxo/magnific_popup/pages/image_module.inc.php on lines 1..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 508.

            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

            <?php
            $moduleInput  = rex_get_file_contents($REX['INCLUDE_PATH'] . '/addons/magnific_popup/module/image/input.php');
            $moduleOutput = rex_get_file_contents($REX['INCLUDE_PATH'] . '/addons/magnific_popup/module/image/output.php');
            
            // Ist Modul schon vorhanden ?
            assets/js/magnific_popup/redaxo/magnific_popup/pages/gallery_module.inc.php on lines 1..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 508.

            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 (0 == ($v_dest_file = @fopen($v_header['filename'], 'wb'))) {
                                    TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening ' . $v_header['filename'] . ' in write binary mode');
            
                                    // ----- Change the file status
                                    $v_header['status'] = 'write_error';
            Severity: Major
            Found in class/pcltar.lib.php and 1 other location - About 2 days to fix
            class/pcltar.lib.php on lines 2633..2676

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

            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 (0 == ($v_dest_file = @fopen($v_header['filename'], 'wb'))) {
                            TrFctMessage(__FILE__, __LINE__, 2, 'Error while opening ' . $v_header['filename'] . ' in write binary mode');
            
                            // ----- Change the file status
                            $v_header['status'] = 'write_error';
            Severity: Major
            Found in class/pcltar.lib.php and 1 other location - About 2 days to fix
            class/pcltar.lib.php on lines 2127..2170

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

            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

            $.event.special['click:fast'] = {
                propagate: true,
                add: function(handleObj) {
                    var prop = this.propagate;
                    if ( Galleria.TOUCH ) {
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 2 days to fix
            assets/js/galleria/galleria-1.3.5.js on lines 1056..1096

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

            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

            $.event.special['click:fast'] = {
                propagate: true,
                add: function(handleObj) {
                    var prop = this.propagate;
                    if ( Galleria.TOUCH ) {
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 2 days to fix
            assets/js/galleria/galleria-1.3.3.js on lines 1056..1096

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

            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

                    rescale: function(event) {
            
                        // calculate
                         var width = M.min( $win.width()-40, lightbox.width ),
                            height = M.min( $win.height()-60, lightbox.height ),
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 2 days to fix
            assets/js/galleria/galleria-1.3.5.js on lines 2273..2311

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

            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