mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

    Method postPhotoTraitement has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function postPhotoTraitement($file, $checkMd5 = false)
        {
            //        require_once XOOPS_ROOT_PATH.'/modules/extgallery/class/photoUploader.php';
    
            $catHandler = Extgallery\Helper::getInstance()->getHandler('PublicCategory');
    Severity: Major
    Found in class/PhotoHandler.php - About 2 hrs to fix

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

          hasInfo : function( index ) {
      
              var check = 'title description'.split(' '),
                  i;
      
      
      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 5483..5495

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

      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

          hasInfo : function( index ) {
      
              var check = 'title description'.split(' '),
                  i;
      
      
      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 5504..5516

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

      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

      CategoryHandler has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class CategoryHandler extends Extgallery\PersistableObjectHandler
      {
          //var $_nestedTree;
          public $_photoHandler;
      
      
      Severity: Minor
      Found in class/CategoryHandler.php - About 2 hrs to fix

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

            trigger : function( type ) {
        
                type = typeof type === 'object' ?
                    $.extend( type, { scope: this } ) :
                    { type: _patchEvent( type ), scope: this };
        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 4076..4085

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

        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

            trigger : function( type ) {
        
                type = typeof type === 'object' ?
                    $.extend( type, { scope: this } ) :
                    { type: _patchEvent( type ), scope: this };
        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 4058..4067

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

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

            addPan : function( img ) {
        
                if ( this._options.image_crop === false ) {
                    return;
                }
        Severity: Major
        Found in assets/js/galleria/galleria-1.1.js - About 2 hrs to fix

          Function success has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      success: function() {
                          // calculate some cropping
                          var newWidth = ( width - options.margin * 2 ) / self.original.width,
                              newHeight = ( height - options.margin * 2 ) / self.original.height,
                              cropMap = {
          Severity: Major
          Found in assets/js/galleria/galleria-1.1.js - About 2 hrs to fix

            Function deleteDirectory has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function deleteDirectory($src)
                {
                    // Only continue if user is a 'global' Admin
                    if (!($GLOBALS['xoopsUser'] instanceof \XoopsUser) || !$GLOBALS['xoopsUser']->isAdmin()) {
                        return false;
            Severity: Minor
            Found in class/Common/FilesManagement.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 _raiseError has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                protected static function _raiseError(
                    $object,
                    $message = null,
                    $code = null,
                    $mode = null,
            Severity: Minor
            Found in class/pear/PEAR.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 _PEAR_call_destructors has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

            function _PEAR_call_destructors()
            {
                global $_PEAR_destructor_object_list;
                if (is_array($_PEAR_destructor_object_list)
                    && count($_PEAR_destructor_object_list)) {
            Severity: Minor
            Found in class/pear/PEAR.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 PclTarHandleReadHeader has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                function PclTarHandleReadHeader($v_binary_data, &$v_header)
                {
                    TrFctStart(__FILE__, __LINE__, 'PclTarHandleReadHeader', '');
                    $v_result = 1;
            
            
            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 SetCharSet has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                public function SetCharSet($vCharSet)
                {
                    // check for input type
                    if (\is_array($vCharSet)) {
                        $this->aCharSet = $vCharSet;
            Severity: Minor
            Found in class/PhpCaptcha.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 init has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    init : function() {
            
                        // trigger the event
                        self.trigger( Galleria.LIGHTBOX_OPEN );
            
            
            Severity: Major
            Found in assets/js/galleria/galleria-1.1.js - About 2 hrs to fix

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

              Galleria.get = function( index ) {
                  if ( !!_instances[ index ] ) {
                      return _instances[ index ];
                  } else if ( typeof index !== 'number' ) {
                      return _instances;
              Severity: Major
              Found in assets/js/galleria/galleria-1.3.5.js and 2 other locations - About 2 hrs to fix
              assets/js/galleria/galleria-1.1.js on lines 3336..3344
              assets/js/galleria/galleria-1.3.3.js on lines 5746..5754

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

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

              Galleria.get = function( index ) {
                  if ( !!_instances[ index ] ) {
                      return _instances[ index ];
                  } else if ( typeof index !== 'number' ) {
                      return _instances;
              Severity: Major
              Found in assets/js/galleria/galleria-1.3.3.js and 2 other locations - About 2 hrs to fix
              assets/js/galleria/galleria-1.1.js on lines 3336..3344
              assets/js/galleria/galleria-1.3.5.js on lines 5767..5775

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

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

              Galleria.get = function( index ) {
                  if ( !!_galleries[ index ] ) {
                      return _galleries[ index ];
                  } else if ( typeof index !== 'number' ) {
                      return _galleries;
              Severity: Major
              Found in assets/js/galleria/galleria-1.1.js and 2 other locations - About 2 hrs to fix
              assets/js/galleria/galleria-1.3.3.js on lines 5746..5754
              assets/js/galleria/galleria-1.3.5.js on lines 5767..5775

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

              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 ('' != $p_message) {
                          $i                                  = \count($g_pcl_trace_entries);
                          $g_pcl_trace_entries[$i]['name']    = '';
                          $g_pcl_trace_entries[$i]['param']   = '';
                          $g_pcl_trace_entries[$i]['message'] = $p_message;
              Severity: Major
              Found in class/pcltrace.lib.php and 1 other location - About 2 hrs to fix
              class/pcltrace.lib.php on lines 190..199

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

              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 ('' != $p_message) {
                          $i                                  = \count($g_pcl_trace_entries);
                          $g_pcl_trace_entries[$i]['name']    = '';
                          $g_pcl_trace_entries[$i]['param']   = '';
                          $g_pcl_trace_entries[$i]['message'] = $p_message;
              Severity: Major
              Found in class/pcltrace.lib.php and 1 other location - About 2 hrs to fix
              class/pcltrace.lib.php on lines 252..261

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

              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