XoopsModules25x/apcal

View on GitHub

Showing 1,049 of 26,336 total issues

Function SetCacheFilename has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function SetCacheFilename()
    {
        if (!is_null($this->cache_filename)) {
            $this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__);

Severity: Minor
Found in thumbs/phpthumb.class.php - About 4 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 OutputThumbnail has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function OutputThumbnail()
    {
        $this->purgeTempFiles();

        if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) {
Severity: Minor
Found in thumbs/phpthumb.class.php - About 4 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

Method get_mini_calendar_html has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public function get_mini_calendar_html($get_target = '', $query_string = '', $mode = '')
        {
            // �¹Ի��ַ�¬��������
            // list( $usec , $sec ) = explode( " " , microtime() ) ;
            // $apcalstarttime = $sec + $usec ;
Severity: Major
Found in class/APCal.php - About 4 hrs to fix

    Function _init has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Calendar.prototype._init = function (firstDayOfWeek, date) {
        var today = new Date(),
            TY = today.getFullYear(),
            TM = today.getMonth(),
            TD = today.getDate();
    Severity: Major
    Found in assets/js/jscalendar/calendar.js - About 4 hrs to fix

      Function htmlCreate has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

              htmlCreate: function () {
                  if (!hs.fireEvent(this, 'onBeforeGetContent')) return;
      
                  this.content = hs.getCacheBinding(this.a);
                  if (!this.content)
      Severity: Minor
      Found in assets/images/js/highslide/highslide-full.js - About 4 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 hideShowCovered has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

      Calendar.prototype.hideShowCovered = function () {
          if (!Calendar.is_ie && !Calendar.is_opera)
              return;
          function getVisib(obj) {
              var value = obj.style.visibility;
      Severity: Minor
      Found in assets/js/jscalendar/calendar.js - About 4 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 createOverlay has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

              createOverlay: function (o) {
                  var el = o.overlayId,
                      relToVP = (o.relativeTo == 'viewport' && !/panel$/.test(o.position));
                  if (typeof el == 'string') el = hs.getNode(el);
                  if (o.html) el = hs.createElement('div', {innerHTML: o.html});
      Severity: Minor
      Found in assets/images/js/highslide/highslide-with-gallery.js - About 4 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 contentLoaded has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

              contentLoaded: function () {
                  try {
                      if (!this.content) return;
                      this.content.onload = null;
                      if (this.onLoadStarted) return;
      Severity: Minor
      Found in assets/images/js/highslide/highslide-with-html.js - About 4 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 WatermarkOverlay has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          public function WatermarkOverlay(
              &$gdimg_dest,
              &$img_watermark,
              $alignment = '*',
              $opacity = 50,
      Severity: Minor
      Found in thumbs/phpthumb.filters.php - About 4 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

      Method SetCacheFilename has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function SetCacheFilename()
          {
              if (!is_null($this->cache_filename)) {
                  $this->DebugMessage('$this->cache_filename already set, skipping SetCacheFilename()', __FILE__, __LINE__);
      
      
      Severity: Major
      Found in thumbs/phpthumb.class.php - About 4 hrs to fix

        Method ResolveFilenameToAbsolute has 102 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function ResolveFilenameToAbsolute($filename)
            {
                if (empty($filename)) {
                    return false;
                }
        Severity: Major
        Found in thumbs/phpthumb.class.php - About 4 hrs to fix

          Method apcal_minical_ex_show has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function apcal_minical_ex_show($options)
              {
                  global $xoopsConfig, $xoopsDB, $xoopsUser;
          
                  // speed check
          Severity: Major
          Found in blocks/apcal_minical_ex.php - About 4 hrs to fix

            Function getOverlays has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                    getOverlays: function () {
                        this.getInline(['heading', 'caption'], true);
                        if (this.heading && this.dragByHeading) this.heading.className += ' highslide-move';
                        if (hs.showCredits) this.writeCredits();
                        for (var i = 0; i < hs.overlays.length; i++) {
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-html.js - About 3 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 AntiOffsiteLinking has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                public function AntiOffsiteLinking()
                {
                    // Optional anti-offsite hijacking of the thumbnail script
                    $allow = true;
                    if ($allow && $this->config_nooffsitelink_enabled
            Severity: Minor
            Found in thumbs/phpthumb.class.php - About 3 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 GD2ICOstring has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

                public function GD2ICOstring(&$gd_image_array)
                {
                    foreach ($gd_image_array as $key => $gd_image) {
                        $ImageWidths[$key]  = imagesx($gd_image);
                        $ImageHeights[$key] = imagesy($gd_image);
            Severity: Minor
            Found in thumbs/phpthumb.ico.php - About 3 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

            Method get_minical_ex has 97 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    public function get_minical_ex($gifaday = 2, $just1gif = 0, $plugins = array())
                    {
                        $db   = XoopsDatabaseFactory::getDatabaseConnection();
                        $myts = MyTextSanitizer::getInstance();
            
            
            Severity: Major
            Found in class/APCal_xoops.php - About 3 hrs to fix

              Method startElementHandler has 94 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      public function startElementHandler($fname, $tagname, $attributes, $line, $lineno)
                      {
                          //  check for whitespace attribute
                          if ($attributes['whitespace']) {
                              array_push($this->whitespace, strtolower($attributes['whitespace']));
              Severity: Major
              Found in include/patTemplate.php - About 3 hrs to fix

                Function onGraphicLoad has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                        onGraphicLoad: function () {
                            var o = this.offset = this.graphic.width / 4,
                                pos = [[0, 0], [0, -4], [-2, 0], [0, -8], 0, [-2, -8], [0, -2], [0, -6], [-2, -2]],
                                dim = {height: (2 * o) + 'px', width: (2 * o) + 'px'};
                            for (var i = 0; i <= 8; i++) {
                Severity: Minor
                Found in assets/images/js/highslide/highslide-full.js - About 3 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 sizeOverlayBox has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                        sizeOverlayBox: function (doWrapper, doPanels) {
                            var overlayBox = this.overlayBox,
                                x = this.x,
                                y = this.y;
                            hs.setStyles(overlayBox, {
                Severity: Minor
                Found in assets/images/js/highslide/highslide-full.js - About 3 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 onGraphicLoad has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                        onGraphicLoad: function () {
                            var o = this.offset = this.graphic.width / 4,
                                pos = [[0, 0], [0, -4], [-2, 0], [0, -8], 0, [-2, -8], [0, -2], [0, -6], [-2, -2]],
                                dim = {height: (2 * o) + 'px', width: (2 * o) + 'px'};
                            for (var i = 0; i <= 8; i++) {
                Severity: Minor
                Found in assets/images/js/highslide/highslide-with-gallery.js - About 3 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

                Severity
                Category
                Status
                Source
                Language