mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

Method build_settings_rows has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function build_settings_rows($aFields)
    {
        // order the fields by priority
        uasort($aFields, [$this, 'compare_elems']);

Severity: Major
Found in assets/js/ml-slider/ml-slider.php - About 2 hrs to fix

    Method PclTarHandleAddList has 70 lines of code (exceeds 25 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: Major
    Found in class/pcltar.lib.php - About 2 hrs to fix

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

                  if (currentOpts.width.toString().indexOf('%') > -1) {
                      to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
                  } else {
                      to.width = currentOpts.width + double_padding;
                  }
      Severity: Major
      Found in assets/js/fancybox/fancybox.js and 1 other location - About 2 hrs to fix
      assets/js/fancybox/fancybox.js on lines 695..699

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

      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

              exit: function( callback ) {
      
                  fullscreen.beforeExit(function() {
      
                      callback = fullscreen.parseCallback( callback );
      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 1872..1884

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

      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

              exit: function( callback ) {
      
                  fullscreen.beforeExit(function() {
      
                      callback = fullscreen.parseCallback( callback );
      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 1877..1889

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

      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 (currentOpts.height.toString().indexOf('%') > -1) {
                      to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
                  } else {
                      to.height = currentOpts.height + double_padding;
                  }
      Severity: Major
      Found in assets/js/fancybox/fancybox.js and 1 other location - About 2 hrs to fix
      assets/js/fancybox/fancybox.js on lines 689..693

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

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

          function isBlockCloned($bid, $bside, $bweight, $bvisible, $bcachetime, $bmodule, $options)
          {
              xoops_loadLanguage('admin', 'system');
              xoops_loadLanguage('admin/blocksadmin', 'system');
              xoops_loadLanguage('admin/groups', 'system');
      Severity: Minor
      Found in admin/blocksadmin.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 xoops_module_install_extgallery has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

      function xoops_module_install_extgallery(\XoopsModule $module)
      {
          $module_id = $module->getVar('mid');
          /** @var \XoopsGroupPermHandler $grouppermHandler */
          $grouppermHandler = xoops_getHandler('groupperm');
      Severity: Minor
      Found in include/install_function.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 PclTarHandleExtractByIndexList has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          function PclTarHandleExtractByIndexList(
              $p_tarname,
              $p_index_string,
              &$p_list_detail,
              $p_path,
      Severity: Minor
      Found in class/pcltar.lib.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 convertResultSet has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function convertResultSet($result, $id_as_key = false, $as_object = true)
          {
              $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1);
              \trigger_error(__CLASS__ . '::' . __FUNCTION__ . '() is deprecated.' . ". Called from {$trace[0]['file']}line {$trace[0]['line']}", \E_USER_WARNING);
              $ret = [];
      Severity: Minor
      Found in class/ModelReadIterator.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 launch has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function launch(target) {
              if (!closing) {
      
                  element = target;
      
      
      Severity: Major
      Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js - About 2 hrs to fix

        Function initGallery has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                initGallery: function() {
        
                    var gSt = mfp.st.gallery,
                        ns = '.mfp-gallery',
                        supportsFastClick = Boolean($.fn.mfpFastClick);
        Severity: Major
        Found in assets/js/magnific_popup/jquery.magnific-popup.js - About 2 hrs to fix

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

          (function($) {
              $.fn.microgallery = function(options) {
                  var opts = $.extend({}, $.fn.microgallery.defaults, options);
                  return this.each(function() {
                      var $this = $(this);
          Severity: Minor
          Found in assets/js/microgallery/jquery.microgallery.js - About 2 hrs to fix

            Function _parseData has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _parseData : function( callback ) {
            
                    var self = this,
                        current,
                        ready = false,
            Severity: Major
            Found in assets/js/galleria/galleria-1.3.5.js - About 2 hrs to fix

              Function loadCSS has 67 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                          loadCSS : function( href, id, callback ) {
              
                              var link,
                                  ready = false,
                                  length;
              Severity: Major
              Found in assets/js/galleria/galleria-1.1.js - About 2 hrs to fix

                Function _parseData has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _parseData : function( callback ) {
                
                        var self = this,
                            current,
                            ready = false,
                Severity: Major
                Found in assets/js/galleria/galleria-1.3.3.js - About 2 hrs to fix

                  MetaSlider has 24 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class MetaSlider
                  {
                      public $id         = 0; // slider ID
                      public $identifier = 0; // unique identifier
                      public $slides     = []; //slides belonging to this slider
                  Severity: Minor
                  Found in assets/js/ml-slider/inc/slider/metaslider.class.php - About 2 hrs to fix

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

                            removeEvent : function() {
                                idle.bound = false;
                                self.$('container').on( 'mousemove click', idle.showAll );
                                if ( self._options.idleMode == 'hover' ) {
                                    self.$('container').off( 'mouseleave', idle.hide );
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.3.js and 3 other locations - About 2 hrs to fix
                    assets/js/galleria/galleria-1.3.3.js on lines 2034..2040
                    assets/js/galleria/galleria-1.3.5.js on lines 2039..2045
                    assets/js/galleria/galleria-1.3.5.js on lines 2047..2053

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

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

                            addEvent : function() {
                                idle.bound = true;
                                self.$('container').on( 'mousemove click', idle.showAll );
                                if ( self._options.idleMode == 'hover' ) {
                                    self.$('container').on( 'mouseleave', idle.hide );
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.5.js and 3 other locations - About 2 hrs to fix
                    assets/js/galleria/galleria-1.3.3.js on lines 2034..2040
                    assets/js/galleria/galleria-1.3.3.js on lines 2042..2048
                    assets/js/galleria/galleria-1.3.5.js on lines 2047..2053

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

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

                            removeEvent : function() {
                                idle.bound = false;
                                self.$('container').on( 'mousemove click', idle.showAll );
                                if ( self._options.idleMode == 'hover' ) {
                                    self.$('container').off( 'mouseleave', idle.hide );
                    Severity: Major
                    Found in assets/js/galleria/galleria-1.3.5.js and 3 other locations - About 2 hrs to fix
                    assets/js/galleria/galleria-1.3.3.js on lines 2034..2040
                    assets/js/galleria/galleria-1.3.3.js on lines 2042..2048
                    assets/js/galleria/galleria-1.3.5.js on lines 2039..2045

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

                    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