mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

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

                    if ((to.width ) > view[0]) {
                        to.width = view[0];
                        to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
                    }
Severity: Major
Found in assets/js/fancybox/fancybox.js and 1 other location - About 1 hr to fix
assets/js/fancybox/fancybox.js on lines 710..713

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

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

        moveTo: function( index ) {
            if ( index != this.index ) {
                this.pos = this.to = -( index*this.width );
                this.index = index;
            }
Severity: Major
Found in assets/js/galleria/galleria-1.3.5.js and 1 other location - About 1 hr to fix
assets/js/galleria/galleria-1.3.3.js on lines 6723..6728

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

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 ((to.height) > view[1]) {
                        to.height = view[1];
                        to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
                    }
Severity: Major
Found in assets/js/fancybox/fancybox.js and 1 other location - About 1 hr to fix
assets/js/fancybox/fancybox.js on lines 705..708

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

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

    _scaleImage : function( image, options ) {

        image = image || this._controls.getActive();

        // janpub (JH) fix:
Severity: Minor
Found in assets/js/galleria/galleria-1.3.5.js - About 1 hr to fix

    Function _scaleImage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _scaleImage : function( image, options ) {
    
            image = image || this._controls.getActive();
    
            // janpub (JH) fix:
    Severity: Minor
    Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix

      Method cloneBlock has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function cloneBlock($bid)
          {
              xoops_cp_header();
              $moduleDirName      = \basename(\dirname(__DIR__));
              $moduleDirNameUpper = \mb_strtoupper($moduleDirName);
      Severity: Minor
      Found in admin/blocksadmin.php - About 1 hr to fix

        Method getSearchedPhoto has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getSearchedPhoto($queryArray, $condition, $limit, $start, $userId)
            {
                $criteria = new CriteriaCompo();
                if ($userId > 0) {
                    $criteria->add(new Criteria('uid', $userId));
        Severity: Minor
        Found in class/PhotoHandler.php - About 1 hr to fix

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

                                                              'sph'              => [
                                                                  'priority' => 120,
                                                                  'type'     => 'number',
                                                                  'size'     => 3,
                                                                  'min'      => 0,
          Severity: Major
          Found in assets/js/ml-slider/ml-slider.php and 1 other location - About 1 hr to fix
          assets/js/ml-slider/ml-slider.php on lines 1121..1133

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

          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

                                                              'spw'              => [
                                                                  'priority' => 110,
                                                                  'type'     => 'number',
                                                                  'size'     => 3,
                                                                  'min'      => 0,
          Severity: Major
          Found in assets/js/ml-slider/ml-slider.php and 1 other location - About 1 hr to fix
          assets/js/ml-slider/ml-slider.php on lines 1134..1146

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

          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

              setOptions : function( key, value ) {
                  if ( typeof key === 'object' ) {
                      $.extend( this._options, key );
                  } else {
                      this._options[ key ] = value;
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.5.js and 2 other locations - About 1 hr to fix
          assets/js/galleria/galleria-1.1.js on lines 2951..2958
          assets/js/galleria/galleria-1.3.3.js on lines 5279..5286

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

          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

              setOptions : function( key, value ) {
                  if ( typeof key === 'object' ) {
                      $.extend( this._options, key );
                  } else {
                      this._options[ key ] = value;
          Severity: Major
          Found in assets/js/galleria/galleria-1.3.3.js and 2 other locations - About 1 hr to fix
          assets/js/galleria/galleria-1.1.js on lines 2951..2958
          assets/js/galleria/galleria-1.3.5.js on lines 5300..5307

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

          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

              setOptions : function( key, value ) {
                  if ( typeof key == 'object' ) {
                      $.extend( this._options, key );
                  } else {
                      this._options[ key ] = value;
          Severity: Major
          Found in assets/js/galleria/galleria-1.1.js and 2 other locations - About 1 hr to fix
          assets/js/galleria/galleria-1.3.3.js on lines 5279..5286
          assets/js/galleria/galleria-1.3.5.js on lines 5300..5307

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

          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

                          'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
          Severity: Major
          Found in assets/js/fancybox/fancybox.js and 1 other location - About 1 hr to fix
          assets/js/fancybox/fancybox.js on lines 1030..1030

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

          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

                          'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
          Severity: Major
          Found in assets/js/fancybox/fancybox.js and 1 other location - About 1 hr to fix
          assets/js/fancybox/fancybox.js on lines 1031..1031

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

          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

          The class PhpCaptcha has 17 fields. Consider redesigning PhpCaptcha to keep the number of fields under 15.
          Open

          class PhpCaptcha
          {
              public $oImage;
              public $aFonts;
              public $iWidth;
          Severity: Minor
          Found in class/PhpCaptcha.php by phpmd

          TooManyFields

          Since: 0.1

          Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

          Example

          class Person {
             protected $one;
             private $two;
             private $three;
             [... many more fields ...]
          }

          Source https://phpmd.org/rules/codesize.html#toomanyfields

          Function _initResizeVideo has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function _initResizeVideo( $slide, ratio, maxWidth, maxHeight )
              {
                  var $video = $slide.children();
          
                  $slide
          Severity: Minor
          Found in assets/js/TosRUs/src/js/jquery.tosrus.js - About 1 hr to fix

            Method get_default_parameters has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get_default_parameters()
                {
                    $params = [
                        'type'           => 'flex',
                        'random'         => false,
            Severity: Minor
            Found in assets/js/ml-slider/inc/slider/metaslider.class.php - About 1 hr to fix

              Method editBlock has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function editBlock($bid)
                  {
                      //require __DIR__ . '/admin_header.php';
                      xoops_cp_header();
                      $moduleDirName = \basename(\dirname(__DIR__));
              Severity: Minor
              Found in admin/blocksadmin.php - About 1 hr to fix

                Method encode has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function encode($textarea_id)
                    {
                        \xoops_loadLanguage('extention', 'extgallery');
                
                        /*   $code       = "<img src='"
                Severity: Minor
                Found in EXTRA/class/textsanitizer/gallery/MytsGallery.php - About 1 hr to fix

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

                      'uploadFolders'  => [
                          XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
                          XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/public-photo',
                          XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/public-photo/original',
                          XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/public-photo/large',
                  Severity: Major
                  Found in config/config.php and 1 other location - About 1 hr to fix
                  config/config.php on lines 43..51

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

                  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