mambax7/extgallery

View on GitHub

Showing 701 of 9,653 total issues

Function PclTarHandleAddFile has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    function PclTarHandleAddFile($p_tar, $p_filename, $p_mode, &$p_header, $p_add_dir, $p_remove_dir)
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarHandleAddFile', "tar='$p_tar', filename='$p_filename', p_mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
        $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

Function truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    {
        if ($considerHtml) {
            // if the plain text is shorter than the maximum length, return the whole text
            if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
Severity: Minor
Found in class/Common/SysUtility.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 truncateHtml has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
Open

    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
    {
        $open_tags = [];
        if ($considerHtml) {
            // if the plain text is shorter than the maximum length, return the whole text
Severity: Minor
Found in class/Utility.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

Method PclTarHandleUpdate has 201 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function PclTarHandleUpdate($p_tarname, $p_file_list, &$p_list_detail, $p_tar_mode, $p_add_dir, $p_remove_dir)
    {
        TrFctStart(__FILE__, __LINE__, 'PclTarHandleUpdate', "archive='$p_tarname', list, tar_mode=$p_tar_mode");
        $v_result     = 1;
        $v_nb         = 0;
Severity: Major
Found in class/pcltar.lib.php - About 1 day to fix

    File photo.php has 495 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    use Xmf\Request;
    
    /**
    Severity: Minor
    Found in admin/photo.php - About 7 hrs to fix

      Function Finger has 195 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.5.js - About 7 hrs to fix

        Function _show has 194 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.3.js - About 7 hrs to fix

          Function PclTarHandleExtractByIndex has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
          Open

              function PclTarHandleExtractByIndex(
                  $p_tar,
                  &$p_index_current,
                  $p_index_start,
                  $p_index_stop,
          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 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

              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

                    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

                            Function objectToArray has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function objectToArray($objects, $externalKeys = [], $format = 's')
                                {
                                    static $cached;
                            
                                    $ret = [];
                            Severity: Minor
                            Found in class/PersistableObjectHandler.php - About 6 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 historyCheck has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                            Open

                                historyCheck: function(){
                                    // if ((jQuery.browser.msie) && (jQuery.browser.version < 8)) {
                                    if (jQuery.browser.msie) {
                                        // On IE, check for location.hash of iframe
                                        var ihistory = jQuery("#jQuery_history")[0];
                            Severity: Minor
                            Found in assets/js/galleriffic/jquery.history.js - About 6 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

                            Severity
                            Category
                            Status
                            Source
                            Language