mambax7/extgallery

View on GitHub

Showing 9,653 of 9,653 total issues

Method convertorderbytrans has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function convertorderbytrans($SortbyOrderby)
{
    $orderbyTrans = [];
    if ('photo_date DESC' === $SortbyOrderby) {
        $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DATEASC;
Severity: Minor
Found in public-album.php - About 1 hr to fix

    Method convertorderbytrans has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function convertorderbytrans($SortbyOrderby)
    {
        $orderbyTrans = [];
        if ('photo_date DESC' === $SortbyOrderby) {
            $orderbyTrans = _MD_EXTGALLERY_ORDERBY_DATEASC;
    Severity: Minor
    Found in public-useralbum.php - About 1 hr to fix

      Method rm has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function rm($args)
          {
              $opts = self::_parseArgs($args, 'rf'); // "f" does nothing but I like it :-)
              if (PEAR::isError($opts)) {
                  return self::raiseError($opts);
      Severity: Minor
      Found in class/pear/System.php - About 1 hr to fix

        Method _mediumPhotoTreatment has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _mediumPhotoTreatment($photoName, $filePath = null, $mediumFilePath = null)
            {
                /** @var Extgallery\Helper $helper */
                $helper = Extgallery\Helper::getInstance();
        
        
        Severity: Minor
        Found in class/PhotoHandler.php - About 1 hr to fix

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

              if ($previousVersion < 107) {
                  // Fix extension Bug if it's installed
                  if (file_exists(XOOPS_ROOT_PATH . '/class/textsanitizer/gallery/gallery.php')) {
                      $conf                          = require XOOPS_ROOT_PATH . '/class/textsanitizer/config.php';
                      $conf['extensions']['gallery'] = 1;
          Severity: Major
          Found in include/onupdate.php and 1 other location - About 1 hr to fix
          include/update_function.php on lines 90..97

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

          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

                      if (1 != ($v_result = PclTarHandleReadHeader($v_binary_data, $v_header))) {
                          // ----- Close the archive file
                          if ('tar' === $p_tar_mode) {
                              fclose($v_tar);
                              fclose($v_temp_tar);
          Severity: Major
          Found in class/pcltar.lib.php and 1 other location - About 1 hr to fix
          class/pcltar.lib.php on lines 2810..2825

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

          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

                      if (1 != ($v_result = PclTarHandleReadHeader($v_binary_data, $v_header))) {
                          // ----- Close the archive file
                          if ('tar' === $p_tar_mode) {
                              fclose($v_tar);
                              fclose($v_temp_tar);
          Severity: Major
          Found in class/pcltar.lib.php and 1 other location - About 1 hr to fix
          class/pcltar.lib.php on lines 3083..3098

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

          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 ($oldVersion < 107) {
                  // Fix extension Bug if it's installed
                  if (file_exists(XOOPS_ROOT_PATH . '/class/textsanitizer/gallery/gallery.php')) {
                      $conf                          = require XOOPS_ROOT_PATH . '/class/textsanitizer/config.php';
                      $conf['extensions']['gallery'] = 1;
          Severity: Major
          Found in include/update_function.php and 1 other location - About 1 hr to fix
          include/onupdate.php on lines 132..139

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

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

                  add: function(element, interval, label, fn, times) {
                      var counter = 0;
          
                      if (jQuery.isFunction(label)) {
                          if (!times)
          Severity: Minor
          Found in assets/js/galleryview/timers.js - About 1 hr 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 extgallery_tag_iteminfo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function extgallery_tag_iteminfo(&$items)
          {
              if (empty($items) || !is_array($items)) {
                  return false;
              }
          Severity: Minor
          Found in class/plugins/plugin.tag.php - About 1 hr 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 PclTarCreate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              function PclTarCreate($p_tarname, $p_filelist = '', $p_mode = '', $p_add_dir = '', $p_remove_dir = '')
              {
                  TrFctStart(__FILE__, __LINE__, 'PclTarCreate', "tar=$p_tarname, file='$p_filelist', 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 hr 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 _postProcess has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _postProcess($type, $quality)
              {
                  array_unshift($this->command, $this->_prepare_cmd(IMAGE_TRANSFORM_NETPBM_PATH, mb_strtolower($this->type) . 'topnm', escapeshellarg($this->image)));
                  $arg     = '';
                  $type    = mb_strtolower($type);
          Severity: Minor
          Found in class/pear/Image/Transform/Driver/NetPBM.php - About 1 hr 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 __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct($error_class = null)
              {
                  $classname = strtolower(get_class($this));
                  if ($this->_debug) {
                      print "PEAR constructor called, class=$classname\n";
          Severity: Minor
          Found in class/pear/PEAR.php - About 1 hr 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 rrmdir has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function rrmdir($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 1 hr 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

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

                              if (settings.mh && photo.height > settings.mh) {
                                  percent = (photo.height - settings.mh) / photo.height;
                                  setResize();
                              }
          Severity: Major
          Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js and 1 other location - About 1 hr to fix
          assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js on lines 950..953

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

          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 ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
          Severity: Major
          Found in assets/js/ml-slider/assets/tipsy/jquery.tipsy.js and 1 other location - About 1 hr to fix
          assets/js/ml-slider/assets/tipsy/jquery.tipsy.js on lines 252..252

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

          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 ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
          Severity: Major
          Found in assets/js/ml-slider/assets/tipsy/jquery.tipsy.js and 1 other location - About 1 hr to fix
          assets/js/ml-slider/assets/tipsy/jquery.tipsy.js on lines 251..251

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

          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 (settings.mw && photo.width > settings.mw) {
                                  percent = (photo.width - settings.mw) / photo.width;
                                  setResize();
                              }
          Severity: Major
          Found in assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js and 1 other location - About 1 hr to fix
          assets/js/ml-slider/assets/colorbox/jquery.colorbox-min.js on lines 954..957

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

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

              _getSizes: function() {
          
                  var self = this,
                      norm = {
                          small: '72c',
          Severity: Minor
          Found in assets/js/galleria/plugins/picasa/galleria.picasa.js - About 1 hr to fix

            Function add has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    add: function(elem, to, from, hide) {
                        if (!elem) {
                            return;
                        }
                        if (!idle.bound) {
            Severity: Minor
            Found in assets/js/galleria/galleria-1.3.3.js - About 1 hr to fix
              Severity
              Category
              Status
              Source
              Language