mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

Function extgalleryAjax has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function extgalleryAjax($options)
{
    $photos = [];
    /** @var Extgallery\PhotoHandler $photoHandler */
    $photoHandler       = Extgallery\Helper::getInstance()->getHandler('PublicPhoto');
Severity: Minor
Found in blocks/extgallery_blocks.php - About 2 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 getDescendants has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDescendants($id = 0, $includeSelf = false, $childrenOnly = false)
    {
        $idField = $this->fields['id'];

        $node = $this->getNode($id);
Severity: Minor
Found in class/NestedTree.php - About 2 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 getDescendants has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDescendants(
        $id = 0,
        $includeSelf = false,
        $childrenOnly = false,
        $withRestrict = true,
Severity: Minor
Found in class/CategoryHandler.php - About 2 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 load has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Galleria.prototype.load = function() {

    // pass if no data is provided or picasa option not found
    if ( arguments.length || typeof this._options.picasa !== 'string' ) {
        load.apply( this, Galleria.utils.array( arguments ) );
Severity: Major
Found in assets/js/galleria/plugins/picasa/galleria.picasa.js - About 2 hrs to fix

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

            init: function (options) {
    
                Galleria.requires(1.33, 'This version of Classic theme requires Galleria 1.3.3 or later');
    
                // add some elements
    Severity: Major
    Found in assets/js/galleria/themes/classic/galleria.classic.js - About 2 hrs to fix

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

              init: function (options) {
      
                  Galleria.requires(1.33, 'This version of Classic theme requires Galleria 1.3.3 or later');
      
                  // add some elements
      Severity: Major
      Found in assets/js/galleria/galleria.classic.js - About 2 hrs to fix

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

        $.each( _events, function( i, ev ) {
        
            // legacy events
            var type = /_/.test( ev ) ? ev.replace( /_/g, '' ) : ev;
        
        
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 2 hrs to fix
        assets/js/galleria/galleria-1.3.3.js on lines 5540..5547

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

        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

        $.each( _events, function( i, ev ) {
        
            // legacy events
            var type = /_/.test( ev ) ? ev.replace( /_/g, '' ) : ev;
        
        
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 2 hrs to fix
        assets/js/galleria/galleria-1.3.5.js on lines 5561..5568

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

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

            function slideshow() {
                var
                timeOut,
                className = prefix + "Slideshow_",
                click = "click." + prefix,
        Severity: Major
        Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js - About 2 hrs to fix

          Method factory has 51 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function &factory($driver = '')
              {
                  if ('' == $driver) {
                      $extensions = [
                          'imagick' => 'Imagick3',
          Severity: Major
          Found in class/pear/Image/Transform.php - About 2 hrs to fix

            Function _exit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    _exit: function( callback ) {
            
                        fullscreen.active = false;
            
                        var inBrowser = !self._options.trueFullscreen || !_nativeFullscreen.support,
            Severity: Minor
            Found in assets/js/galleria/galleria-1.3.5.js - About 2 hrs to fix

              Function _exit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      _exit: function( callback ) {
              
                          fullscreen.active = false;
              
                          var inBrowser = !self._options.trueFullscreen || !_nativeFullscreen.support,
              Severity: Minor
              Found in assets/js/galleria/galleria-1.3.3.js - About 2 hrs to fix

                Function FlameViewportScale has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function FlameViewportScale() {
                    this.delay = 600; // Delay after calling update to account for viewport bounce
                    this.orientation;
                    this.screenWidth; // Screen width corrected for orientation
                    this.timeout;
                Severity: Minor
                Found in assets/js/TosRUs/lib/FlameViewportScale.js - About 2 hrs to fix

                  Method getAll has 50 lines of code (exceeds 25 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 2 hrs to fix

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

                                    if (this.$controlsContainer) {
                                        this.$controlsContainer
                                            .find('div.ss-controls a').removeClass().addClass('play')
                                            .attr('title', this.playLinkText)
                                            .attr('href', '#play')
                    Severity: Major
                    Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 2 hrs to fix
                    assets/js/galleriffic/jquery.galleriffic.js on lines 401..407

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

                    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 (this.$controlsContainer) {
                                        this.$controlsContainer
                                            .find('div.ss-controls a').removeClass().addClass('pause')
                                            .attr('title', this.pauseLinkText)
                                            .attr('href', '#pause')
                    Severity: Major
                    Found in assets/js/galleriffic/jquery.galleriffic.js and 1 other location - About 2 hrs to fix
                    assets/js/galleriffic/jquery.galleriffic.js on lines 386..392

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

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

                    Galleria.addTheme = function( theme ) {
                    
                        // make sure we have a name
                        if ( !theme.name ) {
                            Galleria.raise('No theme name specified');
                    Severity: Minor
                    Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

                      Function addTheme has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Galleria.addTheme = function( theme ) {
                      
                          // make sure we have a name
                          if ( !theme.name ) {
                              Galleria.raise('No theme name specified');
                      Severity: Minor
                      Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

                        Method _parseLongOption has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected static function _parseLongOption($arg, $long_options, &$opts, &$argIdx, $args, $skip_unknown)
                            {
                                @list($opt, $opt_arg) = explode('=', $arg, 2);
                        
                                $opt_len = strlen($opt);
                        Severity: Minor
                        Found in class/pear/Console/Getopt.php - About 1 hr to fix

                          Method render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function render()
                              {
                                  // load all child ids for javascript codes
                                  foreach (\array_keys($this->_itemTree) as $item_id) {
                                      $this->_itemTree[$item_id]['allchild'] = [];
                          Severity: Minor
                          Found in class/GroupPermForm.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language