XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

        fade: function (up, to) {
            this.outlineWhileAnimating = false;
            var exp = this, t = up ? hs.expandDuration : 0;

            if (up) {
Severity: Minor
Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr to fix

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

            showHideElements: function (tagName, visibility) {
                var els = document.getElementsByTagName(tagName);
                var prop = tagName == '*' ? 'overflow' : 'visibility';
                for (var i = 0; i < els.length; i++) {
                    if (prop == 'visibility' || (document.defaultView.getComputedStyle(
    Severity: Minor
    Found in assets/images/js/highslide/highslide.js - About 1 hr to fix

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

              getInline: function (types, addOverlay) {
                  for (var i = 0; i < types.length; i++) {
                      var type = types[i], s = null;
                      if (type == 'caption' && !hs.fireEvent(this, 'onBeforeGetCaption')) return;
                      else if (type == 'heading' && !hs.fireEvent(this, 'onBeforeGetHeading')) return;
      Severity: Minor
      Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

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

                showHideElements: function (tagName, visibility) {
                    var els = document.getElementsByTagName(tagName);
                    var prop = tagName == '*' ? 'overflow' : 'visibility';
                    for (var i = 0; i < els.length; i++) {
                        if (prop == 'visibility' || (document.defaultView.getComputedStyle(
        Severity: Minor
        Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr to fix

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

              public static function save($filename, $maxWidth, $maxHeight)
              {
                  $thumbPath = XOOPS_UPLOAD_PATH . '/apcal/thumbs/' . $filename;
                  $imgPath   = XOOPS_UPLOAD_PATH . '/apcal/' . $filename;
                  $nSize     = self::make($filename, $maxWidth, $maxHeight);
          Severity: Minor
          Found in class/thumb.php - About 1 hr to fix

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

                    public function get_time_desc_for_a_day(
                        $event,
                        $tzoffset,
                        $border_for_2400,
                        $justify = true,
            Severity: Minor
            Found in class/APCal.php - About 1 hr to fix

              Method WatermarkText has 12 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      &$gdimg,
                      $text,
                      $size,
                      $alignment,
                      $hex_color = '000000',
              Severity: Major
              Found in thumbs/phpthumb.filters.php - About 1 hr to fix

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

                                if (!hs.allowMultipleInstances && hs.focusKey != this.key) {
                                    try {
                                        hs.expanders[hs.focusKey].close();
                                    } catch (e) {
                                    }
                Severity: Major
                Found in assets/images/js/highslide/highslide-with-html.js and 1 other location - About 1 hr to fix
                assets/images/js/highslide/highslide-full.js on lines 2665..2670

                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

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

                                if (!hs.allowMultipleInstances && hs.focusKey != this.key) {
                                    try {
                                        hs.expanders[hs.focusKey].close();
                                    } catch (e) {
                                    }
                Severity: Major
                Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 1 hr to fix
                assets/images/js/highslide/highslide-with-html.js on lines 2096..2101

                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 APCal has 127 fields. Consider redesigning APCal to keep the number of fields under 15.
                Open

                    class APCal
                    {
                        // SKELTON (they will be defined in language files)
                        public $holidays           = array();
                        public $date_short_names   = array();
                Severity: Minor
                Found in class/APCal.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

                The class phpthumb has 140 fields. Consider redesigning phpthumb to keep the number of fields under 15.
                Open

                class phpthumb
                {
                
                    // public:
                    // START PARAMETERS (for object mode and phpThumb.php)
                Severity: Minor
                Found in thumbs/phpthumb.class.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

                The class CGIFLZW has 19 fields. Consider redesigning CGIFLZW to keep the number of fields under 15.
                Open

                class CGIFLZW
                {
                    public $MAX_LZW_BITS;
                    public $Fresh;
                    public $CodeSize;
                Severity: Minor
                Found in thumbs/phpthumb.gif.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 dim has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        dim: function (exp) {
                            if (!hs.dimmer) {
                                isNew = true;
                                hs.dimmer = hs.createElement('div', {
                                    className: 'highslide-dimming highslide-viewport-size',
                Severity: Minor
                Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

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

                      public function ApplyMask(&$gdimg_mask, &$gdimg_image)
                      {
                          if (phpthumb_functions::gd_version() < 2) {
                              $this->DebugMessage('Skipping ApplyMask() because gd_version is "' . phpthumb_functions::gd_version() . '"', __FILE__, __LINE__);
                  
                  
                  Severity: Minor
                  Found in thumbs/phpthumb.filters.php - About 1 hr to fix

                    Function loadHTML has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            loadHTML: function () {
                                var s = this.cachedGet || this.xhr.responseText,
                                    regBody;
                                if (this.pre) hs.cachedGets[this.src] = s;
                                if (!hs.ie || hs.uaVersion >= 5.5) {
                    Severity: Minor
                    Found in assets/images/js/highslide/highslide-full.js - About 1 hr to fix

                      Function dim has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              dim: function (exp) {
                                  if (!hs.dimmer) {
                                      isNew = true;
                                      hs.dimmer = hs.createElement('div', {
                                          className: 'highslide-dimming highslide-viewport-size',
                      Severity: Minor
                      Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr to fix

                        Function getInline has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                getInline: function (types, addOverlay) {
                                    for (var i = 0; i < types.length; i++) {
                                        var type = types[i], s = null;
                                        if (!this[type + 'Id'] && this.thumbsUserSetId)
                                            this[type + 'Id'] = type + '-for-' + this.thumbsUserSetId;
                        Severity: Minor
                        Found in assets/images/js/highslide/highslide-with-gallery.js - About 1 hr to fix

                          Function loadHTML has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  loadHTML: function () {
                                      var s = this.cachedGet || this.xhr.responseText,
                                          regBody;
                                      if (this.pre) hs.cachedGets[this.src] = s;
                                      if (!hs.ie || hs.uaVersion >= 5.5) {
                          Severity: Minor
                          Found in assets/images/js/highslide/highslide-with-html.js - About 1 hr to fix

                            Method applyPathSegment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function applyPathSegment(&$segments, $segment)
                                {
                                    if ($segment == '.') {
                                        return; // always remove
                                    }
                            Severity: Minor
                            Found in thumbs/phpthumb.class.php - About 1 hr to fix

                              Method GetCode has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function GetCode(&$data, $bInit)
                                  {
                                      if ($bInit) {
                                          $this->CurBit   = 0;
                                          $this->LastBit  = 0;
                              Severity: Minor
                              Found in thumbs/phpthumb.gif.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language