mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

        if ( !this._options.swipe ) {
            $.each( new Array(2), function( i ) {

                // create a new Picture instance
                var image = new Galleria.Picture();
Severity: Major
Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 1 day to fix
assets/js/galleria/galleria-1.3.5.js on lines 2837..2876

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

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

File jquery.colorbox-min.js has 789 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
    Colorbox v1.4.25 - 2013-06-28
    jQuery lightbox and modal window plugin
    (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox
    license: http://www.opensource.org/licenses/mit-license.php
Severity: Major
Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js - About 1 day to fix

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

                foreach ($lines as $line_matchings) {
                    // if there is any html-tag in this line, handle it and add it (uncounted) to the output
                    if (!empty($line_matchings[1])) {
                        // if it's an "empty element" with or without xhtml-conform closing slash
                        if (\preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) {
    Severity: Major
    Found in class/Common/SysUtility.php and 1 other location - About 1 day to fix
    class/Utility.php on lines 111..162

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

    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

                foreach ($lines as $line_matchings) {
                    // if there is any html-tag in this line, handle it and add it (uncounted) to the output
                    if (!empty($line_matchings[1])) {
                        // if it's an "empty element" with or without xhtml-conform closing slash
                        if (\preg_match('/^<(\s*.+?\/\s*|\s*(img|br|input|hr|area|base|basefont|col|frame|isindex|link|meta|param)(\s.+?)?)>$/is', $line_matchings[1])) {
    Severity: Major
    Found in class/Utility.php and 1 other location - About 1 day to fix
    class/Common/SysUtility.php on lines 76..127

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

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

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

    File galleryview.js has 750 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
    **
    **  GalleryView - jQuery Content Gallery Plugin
    **  Author:         Jack Anderson
    **  Version:        2.1 (March 14, 2010)
    Severity: Major
    Found in assets/js/galleryview/galleryview.js - About 1 day to fix

      Function parse_span_elements has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
      Open

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

      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

              if ( options.fullscreenDoubleTap ) {
      
                  this.$( 'stage' ).on( 'touchstart', (function() {
                      var last, cx, cy, lx, ly, now,
                          getData = function(e) {
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 1 day to fix
      assets/js/galleria/galleria-1.3.3.js on lines 3083..3110

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

      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 ( options.fullscreenDoubleTap ) {
      
                  this.$( 'stage' ).on( 'touchstart', (function() {
                      var last, cx, cy, lx, ly, now,
                          getData = function(e) {
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 1 day to fix
      assets/js/galleria/galleria-1.3.5.js on lines 3101..3128

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

      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

      $.fn.galleria = function( options ) {
      
          var selector = this.selector;
      
          // try domReady if element not found
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 1 day to fix
      assets/js/galleria/galleria-1.3.5.js on lines 6802..6848

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

      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

      $.fn.galleria = function( options ) {
      
          var selector = this.selector;
      
          // try domReady if element not found
      Severity: Major
      Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 1 day to fix
      assets/js/galleria/galleria-1.3.3.js on lines 6778..6824

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

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

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

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

            _init: function() {
        
                var self = this,
                    options = this._options;
        
        
        Severity: Major
        Found in assets/js/galleria/galleria-1.3.5.js - About 1 day to fix

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

              var _timer = this._timer = {
          
                  trunk: {},
          
                  add: function( id, fn, delay, loop ) {
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.3.js and 1 other location - About 1 day to fix
          assets/js/galleria/galleria-1.3.5.js on lines 2461..2497

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

          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

              var _timer = this._timer = {
          
                  trunk: {},
          
                  add: function( id, fn, delay, loop ) {
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 1 day to fix
          assets/js/galleria/galleria-1.3.3.js on lines 2451..2487

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

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

              _init: function() {
          
                  var self = this,
                      options = this._options;
          
          
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.3.js - About 1 day to fix

            Function xoops_module_update_extgallery has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
            Open

            function xoops_module_update_extgallery(\XoopsModule $module, $previousVersion = null)
            {
                global $xoopsDB;
            
                $moduleDirName      = \basename(\dirname(__DIR__));
            Severity: Minor
            Found in include/onupdate.php - About 1 day 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 PclTarMerge has a Cognitive Complexity of 82 (exceeds 5 allowed). Consider refactoring.
            Open

                function PclTarMerge($p_tarname, $p_tarname_add, $p_mode = '', $p_mode_add = '')
                {
                    TrFctStart(__FILE__, __LINE__, 'PclTarMerge', "tar='$p_tarname', tar_add='$p_tarname_add', mode='$p_mode', mode_add='$p_mode_add'");
                    $v_result = 1;
            
            
            Severity: Minor
            Found in class/pcltar.lib.php - About 1 day 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

            File extgallery_blocks.php has 690 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * ExtGallery Block settings
             * Manage all Blocks
             *
            Severity: Major
            Found in blocks/extgallery_blocks.php - About 1 day to fix

              File PhotoHandler.php has 659 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              namespace XoopsModules\Extgallery;
              
              /**
              Severity: Major
              Found in class/PhotoHandler.php - About 1 day to fix
                Severity
                Category
                Status
                Source
                Language