mambax7/extcal

View on GitHub

Showing 1,163 of 1,163 total issues

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

        transit: function (adj, exp) {
            var last = exp || hs.getExpander();
            exp = last;
            if (hs.upcoming) return false;
            else hs.last = last;
Severity: Major
Found in assets/js/highslide-full.js and 1 other location - About 7 hrs to fix
assets/js/highslide-with-gallery.js on lines 425..443

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

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 3 locations. Consider refactoring.
Open

    hs.Dimension = function (exp, dim) {
        this.exp = exp;
        this.dim = dim;
        this.ucwh = dim == 'x' ? 'Width' : 'Height';
        this.wh = this.ucwh.toLowerCase();
Severity: Major
Found in assets/js/highslide-full.js and 2 other locations - About 7 hrs to fix
assets/js/highslide-with-gallery.js on lines 1062..1072
assets/js/highslide.js on lines 889..899

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

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 3 locations. Consider refactoring.
Open

    hs.Dimension = function (exp, dim) {
        this.exp = exp;
        this.dim = dim;
        this.ucwh = dim == 'x' ? 'Width' : 'Height';
        this.wh = this.ucwh.toLowerCase();
Severity: Major
Found in assets/js/highslide.js and 2 other locations - About 7 hrs to fix
assets/js/highslide-full.js on lines 1242..1252
assets/js/highslide-with-gallery.js on lines 1062..1072

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

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 3 locations. Consider refactoring.
Open

    hs.Dimension = function (exp, dim) {
        this.exp = exp;
        this.dim = dim;
        this.ucwh = dim == 'x' ? 'Width' : 'Height';
        this.wh = this.ucwh.toLowerCase();
Severity: Major
Found in assets/js/highslide-with-gallery.js and 2 other locations - About 7 hrs to fix
assets/js/highslide-full.js on lines 1242..1252
assets/js/highslide.js on lines 889..899

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

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 blocksadmin.php has 480 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/blocksadmin.php - About 7 hrs to fix

    prototype has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

        hs.Expander.prototype = {
            error: function (e) {
                if (hs.debug) alert('Line ' + e.lineNumber + ': ' + e.message);
                else window.location.href = this.src;
            },
    Severity: Major
    Found in assets/js/highslide-full.js - About 7 hrs to fix

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

              css: function (el, prop) {
                  if (el.style[prop]) {
                      return el.style[prop];
                  } else if (document.defaultView) {
                      return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
      Severity: Major
      Found in assets/js/highslide-full.js and 2 other locations - About 7 hrs to fix
      assets/js/highslide-with-gallery.js on lines 232..250
      assets/js/highslide.js on lines 167..185

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

      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 3 locations. Consider refactoring.
      Open

              css: function (el, prop) {
                  if (el.style[prop]) {
                      return el.style[prop];
                  } else if (document.defaultView) {
                      return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
      Severity: Major
      Found in assets/js/highslide.js and 2 other locations - About 7 hrs to fix
      assets/js/highslide-full.js on lines 278..296
      assets/js/highslide-with-gallery.js on lines 232..250

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

      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 3 locations. Consider refactoring.
      Open

              css: function (el, prop) {
                  if (el.style[prop]) {
                      return el.style[prop];
                  } else if (document.defaultView) {
                      return document.defaultView.getComputedStyle(el, null).getPropertyValue(prop);
      Severity: Major
      Found in assets/js/highslide-with-gallery.js and 2 other locations - About 7 hrs to fix
      assets/js/highslide-full.js on lines 278..296
      assets/js/highslide.js on lines 167..185

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

      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 (!this.outlineType
                  || (this.last && this.isImage && this.transitions[1] == 'crossfade')) {
                  this[this.contentType + 'Create']();
      
              } else if (hs.pendingOutlines[this.outlineType]) {
      Severity: Major
      Found in assets/js/highslide-full.js and 1 other location - About 7 hrs to fix
      assets/js/highslide-with-gallery.js on lines 1243..1260

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

      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 (!this.outlineType
                  || (this.last && this.isImage && this.transitions[1] == 'crossfade')) {
                  this[this.contentType + 'Create']();
      
              } else if (hs.pendingOutlines[this.outlineType]) {
      Severity: Major
      Found in assets/js/highslide-with-gallery.js and 1 other location - About 7 hrs to fix
      assets/js/highslide-full.js on lines 1440..1457

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

      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 ExtcalPersistableObjectHandler.php has 473 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace XoopsModules\Extcal;
      
      /*
      Severity: Minor
      Found in class/ExtcalPersistableObjectHandler.php - About 7 hrs to fix

        Function keyHandler has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
        Open

                keyHandler: function (e) {
                    if (!e) e = window.event;
                    if (!e.target) e.target = e.srcElement; // ie
                    if (typeof e.target.form != 'undefined') return true; // form element has focus
                    if (!hs.fireEvent(hs, 'onKeyDown', e)) return true;
        Severity: Minor
        Found in assets/js/highslide-full.js - About 7 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 Expander has a Cognitive Complexity of 47 (exceeds 5 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: Minor
        Found in assets/js/highslide-with-gallery.js - About 7 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

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

            hs.extend(hs.fx, {
                step: {
        
                    opacity: function (fx) {
                        hs.setStyles(fx.elem, {opacity: fx.now});
        Severity: Major
        Found in assets/js/highslide-with-gallery.js and 2 other locations - About 7 hrs to fix
        assets/js/highslide-full.js on lines 1092..1109
        assets/js/highslide.js on lines 739..756

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

        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 3 locations. Consider refactoring.
        Open

            hs.extend(hs.fx, {
                step: {
        
                    opacity: function (fx) {
                        hs.setStyles(fx.elem, {opacity: fx.now});
        Severity: Major
        Found in assets/js/highslide-full.js and 2 other locations - About 7 hrs to fix
        assets/js/highslide-with-gallery.js on lines 912..929
        assets/js/highslide.js on lines 739..756

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

        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 3 locations. Consider refactoring.
        Open

            hs.extend(hs.fx, {
                step: {
        
                    opacity: function (fx) {
                        hs.setStyles(fx.elem, {opacity: fx.now});
        Severity: Major
        Found in assets/js/highslide.js and 2 other locations - About 7 hrs to fix
        assets/js/highslide-full.js on lines 1092..1109
        assets/js/highslide-with-gallery.js on lines 912..929

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

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

            public function getRecurEventToDisplay($event, $periodStart, $periodEnd)
            {
                $recuEvents   = [];
                $eventOptions = \explode('|', $event['event_recur_rules']);
        
        
        Severity: Minor
        Found in class/EventHandler.php - About 7 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

        hs has 50 functions (exceeds 20 allowed). Consider refactoring.
        Open

            var hs = {
        // Language strings
                lang: {
                    cssDirection: 'ltr',
                    loadingText: 'Loading...',
        Severity: Minor
        Found in assets/js/highslide-full.js - About 7 hrs to fix

          Function keyHandler has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
          Open

                  keyHandler: function (e) {
                      if (!e) e = window.event;
                      if (!e.target) e.target = e.srcElement; // ie
                      if (typeof e.target.form != 'undefined') return true; // form element has focus
                      var exp = hs.getExpander();
          Severity: Minor
          Found in assets/js/highslide-with-gallery.js - About 6 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