XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

        if (cd.navtype < 0)
            s.left = cd.offsetLeft + "px";
        else {
            var ycw = yc.offsetWidth;
            if (typeof ycw == "undefined")
Severity: Major
Found in assets/js/jscalendar/calendar.js and 1 other location - About 3 hrs to fix
assets/js/jscalendar/calendar.js on lines 270..278

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

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 (cd.navtype < 0)
        s.left = cd.offsetLeft + "px";
    else {
        var mcw = mc.offsetWidth;
        if (typeof mcw == "undefined")
Severity: Major
Found in assets/js/jscalendar/calendar.js and 1 other location - About 3 hrs to fix
assets/js/jscalendar/calendar.js on lines 315..323

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

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

        switch (valign) {
            case "T":
                p.y -= h;
                break;
            case "B":
Severity: Major
Found in assets/js/jscalendar/calendar.js and 1 other location - About 3 hrs to fix
assets/js/jscalendar/calendar.js on lines 1434..1449

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

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

        switch (halign) {
            case "L":
                p.x -= w;
                break;
            case "R":
Severity: Major
Found in assets/js/jscalendar/calendar.js and 1 other location - About 3 hrs to fix
assets/js/jscalendar/calendar.js on lines 1417..1432

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

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

    hs.Expander = function (a, params, custom, contentType) {
        if (document.readyState && hs.ie && !hs.isReady) {
            hs.addEventListener(document, 'ready', function () {
                new hs.Expander(a, params, custom, contentType);
            });
Severity: Major
Found in assets/images/js/highslide/highslide-with-html.js - About 3 hrs to fix

    Method AlphaChannelFlatten has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function AlphaChannelFlatten()
        {
            if (!$this->is_alpha) {
                // image doesn't have alpha transparency, no need to flatten
                $this->DebugMessage('skipping AlphaChannelFlatten() because !$this->is_alpha', __FILE__, __LINE__);
    Severity: Major
    Found in thumbs/phpthumb.class.php - About 3 hrs to fix

      Function tableMouseOver has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Calendar.tableMouseOver = function (ev) {
          var cal = Calendar._C;
          if (!cal) {
              return;
          }
      Severity: Major
      Found in assets/js/jscalendar/calendar.js - About 3 hrs to fix

        Function Expander has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            hs.Expander = function (a, params, custom, contentType) {
                if (document.readyState && hs.ie && !hs.isReady) {
                    hs.addEventListener(document, 'ready', function () {
                        new hs.Expander(a, params, custom, contentType);
                    });
        Severity: Major
        Found in assets/images/js/highslide/highslide.js - About 3 hrs to fix

          Method Rotate has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function Rotate()
              {
                  if ($this->ra || $this->ar) {
                      if (!function_exists('ImageRotate')) {
                          $this->DebugMessage('!function_exists(ImageRotate)', __FILE__, __LINE__);
          Severity: Major
          Found in thumbs/phpthumb.class.php - About 3 hrs to fix

            Method getBmp has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getBmp($bgColor)
                {
                    $out = '';
            
                    if (!$this->m_bLoaded) {
            Severity: Major
            Found in thumbs/phpthumb.gif.php - About 2 hrs to fix

              Method GD2ICOstring has 74 lines of code (exceeds 25 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: Major
              Found in thumbs/phpthumb.ico.php - About 2 hrs to fix

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

                            if (isNew) {
                                if (hs.geckoMac && hs.dimmingGeckoFix)
                                    hs.setStyles(hs.dimmer, {
                                        background: 'url(' + hs.graphicsDir + 'geckodimmer.png)',
                                        opacity: 1
                Severity: Major
                Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 2 hrs to fix
                assets/images/js/highslide/highslide-with-gallery.js on lines 401..409

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

                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 (isNew) {
                                if (hs.geckoMac && hs.dimmingGeckoFix)
                                    hs.setStyles(hs.dimmer, {
                                        background: 'url(' + hs.graphicsDir + 'geckodimmer.png)',
                                        opacity: 1
                Severity: Major
                Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 2 hrs to fix
                assets/images/js/highslide/highslide-full.js on lines 544..552

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

                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

                File myblocksadmin.php has 289 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /*
                 * You may not change or alter any portion of this comment or credits
                 * of supporting developers from this source code or any supporting source code
                 * which is considered copyrighted (c) material of the original comment or credit authors.
                Severity: Minor
                Found in admin/myblocksadmin.php - About 2 hrs to fix

                  Function changeSize has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          changeSize: function (up, to, dur) {
                              // transition
                              var trans = this.transitions,
                                  other = up ? (this.last ? this.last.a : null) : hs.upcoming,
                                  t = (trans[1] && other
                  Severity: Major
                  Found in assets/images/js/highslide/highslide-full.js - About 2 hrs to fix

                    Method diff has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function diff($from_lines, $to_lines)
                        {
                            $n_from = count($from_lines);
                            $n_to   = count($to_lines);
                    
                    
                    Severity: Major
                    Found in include/Text_Diff.php - About 2 hrs to fix

                      Method getPng has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getPng($bgColor)
                          {
                              $out = '';
                      
                              if (!$this->m_bLoaded) {
                      Severity: Major
                      Found in thumbs/phpthumb.gif.php - About 2 hrs to fix

                        Method SafeURLread has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function SafeURLread($url, &$error, $timeout = 10, $followredirects = true)
                            {
                                $error = '';
                        
                                $parsed_url                      = phpthumb_functions::ParseURLbetter($url);
                        Severity: Major
                        Found in thumbs/phpthumb.functions.php - About 2 hrs to fix

                          Function updateAnchors has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  updateAnchors: function () {
                                      var el, els, all = [], images = [], htmls = [], groups = {}, re;
                          
                                      for (var i = 0; i < hs.openerTagNames.length; i++) {
                                          els = document.getElementsByTagName(hs.openerTagNames[i]);
                          Severity: Minor
                          Found in assets/images/js/highslide/highslide-full.js - About 2 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 21 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  createOverlay: function (o) {
                                      var el = o.overlayId;
                                      if (typeof el == 'string') el = hs.getNode(el);
                                      if (o.html) el = hs.createElement('div', {innerHTML: o.html});
                                      if (!el || typeof el == 'string') return;
                          Severity: Minor
                          Found in assets/images/js/highslide/highslide-with-html.js - About 2 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