mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

Function Finger has 193 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Galleria.Finger = (function() {

    var abs = M.abs;

    // test for translate3d support
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js - About 7 hrs to fix

    File blocksadmin.php has 476 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * You may not change or alter any portion of this comment or credits
     * of supporting developers from this source code or any supporting source code
     * which is considered copyrighted (c) material of the original comment or credit authors.
    Severity: Minor
    Found in admin/blocksadmin.php - About 7 hrs to fix

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

      $.extend( $.easing, {
      
          galleria: function (_, t, b, c, d) {
              if ((t/=d/2) < 1) {
                  return c/2*t*t*t + b;
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 7 hrs to fix
      assets/js/galleria/galleria-1.3.5.js on lines 6505..6522

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

      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

      $.extend( $.easing, {
      
          galleria: function (_, t, b, c, d) {
              if ((t/=d/2) < 1) {
                  return c/2*t*t*t + b;
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 7 hrs to fix
      assets/js/galleria/galleria-1.3.3.js on lines 6484..6501

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

      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.on = function( type, callback ) {
          if ( !type ) {
              return;
          }
      
      
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 7 hrs to fix
      assets/js/galleria/galleria-1.3.5.js on lines 5824..5848

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

      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.on = function( type, callback ) {
          if ( !type ) {
              return;
          }
      
      
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 7 hrs to fix
      assets/js/galleria/galleria-1.3.3.js on lines 5803..5827

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

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

          _show : function() {
      
              // shortcuts
              var self = this,
                  queue = this._queue[ 0 ],
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.5.js - About 7 hrs to fix

        Method parse_span_elements has 181 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function parse_span_elements($text, $markers = ['![', '&', '*', '<', '[', '_', '`', 'http', '~~'])
            {
                if (false === isset($text[2]) or $markers === []) {
                    return $text;
                }

          Function buildFilmstrip has 178 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function buildFilmstrip() {
                      // Add wrapper to filmstrip to hide extra frames
                      j_filmstrip.wrap('<div class="strip_wrapper"></div>');
                      if(slide_method=='strip') {
                          j_frames.clone().appendTo(j_filmstrip);
          Severity: Major
          Found in assets/js/galleryview/galleryview.js - About 7 hrs to fix

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

                setCounter: function( index ) {
            
                    if ( typeof index === 'number' ) {
                        index++;
                    } else if ( typeof index === 'undefined' ) {
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 7 hrs to fix
            assets/js/galleria/galleria-1.3.5.js on lines 5441..5465

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

            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

                setCounter: function( index ) {
            
                    if ( typeof index === 'number' ) {
                        index++;
                    } else if ( typeof index === 'undefined' ) {
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 7 hrs to fix
            assets/js/galleria/galleria-1.3.3.js on lines 5420..5444

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

            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 PclTarHandleAddList has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                function PclTarHandleAddList($p_tar, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
                {
                    TrFctStart(__FILE__, __LINE__, 'PclTarHandleAddList', "tar='$p_tar', list, mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
                    $v_result = 1;
                    $v_header = [];
            Severity: Minor
            Found in class/pcltar.lib.php - About 7 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 _createThumbnails has 177 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _createThumbnails : function( push ) {
            
                    this.get( 'total' ).innerHTML = this.getDataLength();
            
                    var src,
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.3.js - About 7 hrs to fix

              Function _createThumbnails has 177 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _createThumbnails : function( push ) {
              
                      this.get( 'total' ).innerHTML = this.getDataLength();
              
                      var src,
              Severity: Major
              Found in assets/js/galleria/galleria-1.3.5.js - About 7 hrs to fix

                Function _init has 175 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _init: function() {
                        var self = this;
                
                        if ( this._initialized ) {
                            Galleria.raise( 'Init failed: Gallery instance already initialized.' );
                Severity: Major
                Found in assets/js/galleria/galleria-1.1.js - About 7 hrs to fix

                  PhotoHandler has 48 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class PhotoHandler extends Extgallery\PersistableObjectHandler
                  {
                      public $photoUploader = null;
                  
                      /**
                  Severity: Minor
                  Found in class/PhotoHandler.php - About 6 hrs to fix

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

                        destroy : function() {
                            this.$( 'target' ).data( 'galleria', null );
                            this.$( 'container' ).off( 'galleria' );
                            this.get( 'target' ).innerHTML = this._original.html;
                            this.clearTimer();
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 6 hrs to fix
                    assets/js/galleria/galleria-1.3.3.js on lines 3941..3954

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

                    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

                        destroy : function() {
                            this.$( 'target' ).data( 'galleria', null );
                            this.$( 'container' ).off( 'galleria' );
                            this.get( 'target' ).innerHTML = this._original.html;
                            this.clearTimer();
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 6 hrs to fix
                    assets/js/galleria/galleria-1.3.5.js on lines 3959..3972

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

                    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

                            setup: function() {
                                this.width = $( this.elem ).width();
                                this.length = M.ceil( $(this.child).width() / this.width );
                                if ( this.index !== 0 ) {
                                    this.index = M.max(0, M.min( this.index, this.length-1 ) );
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 6 hrs to fix
                    assets/js/galleria/galleria-1.3.3.js on lines 6629..6636

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

                    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

                            setup: function() {
                                this.width = $( this.elem ).width();
                                this.length = M.ceil( $(this.child).width() / this.width );
                                if ( this.index !== 0 ) {
                                    this.index = M.max(0, M.min( this.index, this.length-1 ) );
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 6 hrs to fix
                    assets/js/galleria/galleria-1.3.5.js on lines 6651..6658

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

                    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