XoopsModules25x/apcal

View on GitHub

Showing 1,049 of 26,336 total issues

Method Sepia has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function Sepia(&$gdimg, $amount, $targetColor)
    {
        $amount      = (is_numeric($amount) ? max(0, min(100, $amount)) : 50);
        $amountPct   = $amount / 100;
        $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'A28065');
Severity: Minor
Found in thumbs/phpthumb.filters.php - About 1 hr to fix

    Method Colorize has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function Colorize(&$gdimg, $amount, $targetColor)
        {
            $amount      = (is_numeric($amount) ? $amount : 25);
            $amountPct   = $amount / 100;
            $targetColor = (phpthumb_functions::IsHexColor($targetColor) ? $targetColor : 'gray');
    Severity: Minor
    Found in thumbs/phpthumb.filters.php - About 1 hr to fix

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

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

                                      public function ResolveSource()
                                      {
                                          if (is_resource($this->gdimg_source)) {
                                              $this->DebugMessage('ResolveSource() exiting because is_resource($this->gdimg_source)', __FILE__, __LINE__);
                                  
                                  
                                  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

                                      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

                                        Function getPageSize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                                getPageSize: function () {
                                                    var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat'
                                                            ? d.documentElement : d.body,
                                                        ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
                                        
                                        
                                        Severity: Minor
                                        Found in assets/images/js/highslide/highslide-full.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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language