mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

Method extgalleryAjaxEdit has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function extgalleryAjaxEdit($options)
{
    $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');

    $form = _MB_EXTGALLERY_PHOTO_NUMBER . ' : <input name="options[]" size="5" maxlength="255" value="' . $options[0] . '" type="text"><br>';
Severity: Major
Found in blocks/extgallery_blocks.php - About 4 hrs to fix

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

            else if(imgheight > maxH){
                var newheight = maxH;
                var ratio = maxH / imgheight;
                var newwidth = imgwidth * ratio;
                if(newwidth > maxW){
    Severity: Major
    Found in assets/js/microgallery/jquery.microgallery.js and 1 other location - About 4 hrs to fix
    assets/js/microgallery/jquery.microgallery.js on lines 261..296

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

    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(imgwidth > maxW){
                var newwidth = maxW;
                var ratio = maxW / imgwidth;
                var newheight = imgheight * ratio;
                if(newheight > maxH){
    Severity: Major
    Found in assets/js/microgallery/jquery.microgallery.js and 1 other location - About 4 hrs to fix
    assets/js/microgallery/jquery.microgallery.js on lines 277..296

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

    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

                        case 'top': pointer.css({
                                        'bottom':(opts.panel_height-(pointer_height*2)+gallery_padding+filmstrip_margin)+'px',
                                        'left':((gallery_width-wrapper_width)/2)+(slide_method=='strip'?0:((f_frame_width+opts.frame_gap)*iterator))+((f_frame_width/2)-(pointer_width/2))+gallery_padding+'px',
                                        'borderBottomColor':transColor,
                                        'borderRightColor':transColor,
    Severity: Major
    Found in assets/js/galleryview/galleryview.js and 1 other location - About 4 hrs to fix
    assets/js/galleryview/galleryview.js on lines 635..641

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

    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

                        case 'bottom': pointer.css({
                                            'top':(opts.panel_height-(pointer_height*2)+gallery_padding+filmstrip_margin)+'px',
                                            'left':((gallery_width-wrapper_width)/2)+(slide_method=='strip'?0:((f_frame_width+opts.frame_gap)*iterator))+((f_frame_width/2)-(pointer_width/2))+gallery_padding+'px',
                                            'borderTopColor':transColor,
                                            'borderRightColor':transColor,
    Severity: Major
    Found in assets/js/galleryview/galleryview.js and 1 other location - About 4 hrs to fix
    assets/js/galleryview/galleryview.js on lines 628..634

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

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

        function PclTarHandleExtractFile($p_tar, &$v_header, $p_path, $p_remove_path, $p_tar_mode)
        {
            TrFctStart(__FILE__, __LINE__, 'PclTarHandleExtractFile', "archive_descr='$p_tar', path=$p_path, remove_path='$p_remove_path', tar_mode=$p_tar_mode");
            $v_result = 1;
    
    
    Severity: Major
    Found in class/pcltar.lib.php - About 4 hrs to fix

      Function remove has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              remove: function(element, label, fn) {
                  var timers = jQuery.data(element, this.dataKey), ret;
      
                  if ( timers ) {
      
      
      Severity: Minor
      Found in assets/js/galleryview/timers.js - About 4 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 FlameViewportScale has a Cognitive Complexity of 30 (exceeds 5 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 4 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

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

          case 'enreg':
              /** @var Extgallery\PublicPhotoHandler $photoHandler */
              $photoHandler = Extgallery\Helper::getInstance()->getHandler('PublicPhoto');
      
              $result = $photoHandler->postPhotoTraitement('photo_file', false);
      Severity: Major
      Found in public-upload.php and 1 other location - About 4 hrs to fix
      admin/photo.php on lines 54..70

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

      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

          case 'add_photo':
      
              /** @var Extgallery\PublicPhotoHandler $photoHandler */
              $photoHandler = Extgallery\Helper::getInstance()->getHandler('PublicPhoto');
              $result       = $photoHandler->postPhotoTraitement('photo_file', false);
      Severity: Major
      Found in admin/photo.php and 1 other location - About 4 hrs to fix
      public-upload.php on lines 41..57

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

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

          load: function(src, size, callback) {
      
              if ( typeof size == 'function' ) {
                  callback = size;
                  size = null;
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.5.js - About 4 hrs to fix

        Function _show has 107 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.1.js - About 4 hrs to fix

          Function load has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              load: function(src, size, callback) {
          
                  if ( typeof size == 'function' ) {
                      callback = size;
                      size = null;
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.3.js - About 4 hrs to fix

            Method _postProcess has 107 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function _postProcess($type, $quality)
                {
                    array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));
                    $arg     = '';
                    $type    = mb_strtolower($type);
            Severity: Major
            Found in class/pear/Image/Transform/Driver/NetPBM.php - About 4 hrs to fix

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

                              $('<img />').addClass('nav-next-overlay').attr('src',theme_path+opts.nav_theme+'/panel-nav-next.png').appendTo(j_gallery).css({
                                  'position':'absolute',
                                  'zIndex':'1099',
                                  'top':((opts.panel_height-22)/2)+gallery_padding-10+'px',
                                  'right':'0',
              Severity: Major
              Found in assets/js/galleryview/galleryview.js and 1 other location - About 4 hrs to fix
              assets/js/galleryview/galleryview.js on lines 411..419

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

              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

                              $('<img />').addClass('nav-prev-overlay').attr('src',theme_path+opts.nav_theme+'/panel-nav-prev.png').appendTo(j_gallery).css({
                                  'position':'absolute',
                                  'zIndex':'1099',
                                  'top':((opts.panel_height-22)/2)+gallery_padding-10+'px',
                                  'left':'0',
              Severity: Major
              Found in assets/js/galleryview/galleryview.js and 1 other location - About 4 hrs to fix
              assets/js/galleryview/galleryview.js on lines 401..409

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

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

                  _run : function() {
                      // shortcuts
                      var self = this,
                          o = this._options,
              
              
              Severity: Major
              Found in assets/js/galleria/galleria-1.1.js - About 4 hrs to fix

                Function _show has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _show = function() {
                            var pos, equal;
                
                            loading.hide();
                
                
                Severity: Major
                Found in assets/js/fancybox/fancybox.js - About 4 hrs to fix

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

                              if ( IFRAME && fullscreen.iframe ) {
                                  Utils.forceStyles( fullscreen.pd.documentElement, htmlbody );
                                  Utils.forceStyles( fullscreen.pd.body, htmlbody );
                                  Utils.forceStyles( fullscreen.iframe, $.extend( htmlbody, {
                                      width: '100%',
                  Severity: Major
                  Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 4 hrs to fix
                  assets/js/galleria/galleria-1.3.5.js on lines 1769..1781

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

                  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 ( IFRAME && fullscreen.iframe ) {
                                  Utils.forceStyles( fullscreen.pd.documentElement, htmlbody );
                                  Utils.forceStyles( fullscreen.pd.body, htmlbody );
                                  Utils.forceStyles( fullscreen.iframe, $.extend( htmlbody, {
                                      width: '100%',
                  Severity: Major
                  Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 4 hrs to fix
                  assets/js/galleria/galleria-1.3.3.js on lines 1769..1781

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

                  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