XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

Function create has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

Calendar.prototype.create = function (_par) {
    var parent = null;
    if (!_par) {
        // default parent is the document body, in which case we create
        // a popup calendar.
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 focus has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

        focus: function () {
            this.wrapper.style.zIndex = hs.zIndexCounter += 2;
            // blur others
            for (var i = 0; i < hs.expanders.length; i++) {
                if (hs.expanders[i] && i == hs.focusKey) {
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 apcal_mini_calendar_show has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
Open

    function apcal_mini_calendar_show($options)
    {
        global $xoopsConfig, $xoopsDB, $xoopsUser;

        $moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0];
Severity: Minor
Found in blocks/apcal_mini_calendar.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 _keyEvent has 113 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Calendar._keyEvent = function (ev) {
    var cal = window._dynarch_popupCalendar;
    if (!cal || cal.multiple)
        return false;
    (Calendar.is_ie) && (ev = window.event);
Severity: Major
Found in assets/js/jscalendar/calendar.js - About 4 hrs to fix

    prototype has 35 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: Minor
    Found in assets/images/js/highslide/highslide.js - About 4 hrs to fix

      Function run has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              run: function () {
                  var xhr;
                  if (!this.src) this.src = hs.getSrc(this.a);
                  if (this.src.match('#')) {
                      var arr = this.src.split('#');
      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 getOverlays has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              getOverlays: function () {
                  this.getInline(['heading', 'caption'], true);
                  this.getNumber();
                  if (this.caption) hs.fireEvent(this, 'onAfterGetCaption');
                  if (this.heading) hs.fireEvent(this, 'onAfterGetHeading');
      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 positionOverlay has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              positionOverlay: function (overlay) {
                  var p = overlay.position || 'middle center',
                      relToVP = (overlay.relativeTo == 'viewport'),
                      offX = overlay.offsetX,
                      offY = overlay.offsetY;
      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 keyHandler has a Cognitive Complexity of 30 (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/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 dragHandler has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              dragHandler: function (e) {
                  if (!hs.dragArgs) return true;
                  if (!e) e = window.event;
                  var a = hs.dragArgs, exp = a.exp;
                  if (exp.iframe) {
      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 run has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              run: function () {
                  var xhr;
                  if (!this.src) this.src = hs.getSrc(this.a);
                  if (this.src.match('#')) {
                      var arr = this.src.split('#');
      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 positionOverlay has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              positionOverlay: function (overlay) {
                  var p = overlay.position || 'middle center',
                      relToVP = (overlay.relativeTo == 'viewport'),
                      offX = overlay.offsetX,
                      offY = overlay.offsetY;
      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 keyHandler has a Cognitive Complexity of 30 (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/images/js/highslide/highslide.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 __construct has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

              public function __construct($target_date = '', $language = 'japanese', $reload = false)
              {
                  // ���դΥ��å�
                  if ($target_date) {
                      $this->set_date($target_date);
      Severity: Minor
      Found in class/APCal.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 PlotPixelsGD has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          public function PlotPixelsGD(&$BMPdata, $truecolor = true)
          {
              $imagewidth  = $BMPdata['header']['raw']['width'];
              $imageheight = $BMPdata['header']['raw']['height'];
      
      
      Severity: Minor
      Found in thumbs/phpthumb.bmp.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 MaxFileSize has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

          public function MaxFileSize()
          {
              if (phpthumb_functions::gd_version() < 2) {
                  $this->DebugMessage('Skipping MaxFileSize() because gd_version is "' . phpthumb_functions::gd_version() . '"', __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

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

              setStyles: function (el, styles) {
                  for (var x in styles) {
                      if (hs.ieLt9 && x == 'opacity') {
                          if (styles[x] > 0.99) el.style.removeAttribute('filter');
                          else el.style.filter = 'alpha(opacity=' + (styles[x] * 100) + ')';
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 4 hrs to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 198..206
      assets/images/js/highslide/highslide-with-html.js on lines 194..202
      assets/images/js/highslide/highslide.js on lines 133..141

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

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

              setStyles: function (el, styles) {
                  for (var x in styles) {
                      if (hs.ieLt9 && x == 'opacity') {
                          if (styles[x] > 0.99) el.style.removeAttribute('filter');
                          else el.style.filter = 'alpha(opacity=' + (styles[x] * 100) + ')';
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 4 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 244..252
      assets/images/js/highslide/highslide-with-gallery.js on lines 198..206
      assets/images/js/highslide/highslide.js on lines 133..141

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

      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

              lang: {
                  cssDirection: 'ltr',
                  loadingText: 'Loading...',
                  loadingTitle: 'Click to cancel',
                  focusTitle: 'Click to bring to front',
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 4 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 12..36

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

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

              setStyles: function (el, styles) {
                  for (var x in styles) {
                      if (hs.ieLt9 && x == 'opacity') {
                          if (styles[x] > 0.99) el.style.removeAttribute('filter');
                          else el.style.filter = 'alpha(opacity=' + (styles[x] * 100) + ')';
      Severity: Major
      Found in assets/images/js/highslide/highslide.js and 3 other locations - About 4 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 244..252
      assets/images/js/highslide/highslide-with-gallery.js on lines 198..206
      assets/images/js/highslide/highslide-with-html.js on lines 194..202

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

      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

      Severity
      Category
      Status
      Source
      Language