XoopsModules25x/apcal

View on GitHub

Showing 1,049 of 26,336 total issues

Function ImageCreateFromStringReplacement has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
Open

    public function ImageCreateFromStringReplacement(&$RawImageData, $DieOnErrors = false)
    {
        // there are serious bugs in the non-bundled versions of GD which may cause
        // PHP to segfault when calling ImageCreateFromString() - avoid if at all possible
        // when not using a bundled version of GD2
Severity: Minor
Found in thumbs/phpthumb.class.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

File blocksadmin.inc.php has 493 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 include/blocksadmin.inc.php - About 7 hrs to fix

    Function changeSize has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
    Open

            changeSize: function (up, to, dur) {
    
                if (this.outline && !this.outlineWhileAnimating) {
                    if (up) this.outline.setPosition();
                    else this.outline.destroy(
    Severity: Minor
    Found in assets/images/js/highslide/highslide-with-html.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

    File Text_Diff.php has 484 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * Text_Diff
     *
    Severity: Minor
    Found in include/Text_Diff.php - About 7 hrs to fix

      Function tableMouseOver has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

      Calendar.tableMouseOver = function (ev) {
          var cal = Calendar._C;
          if (!cal) {
              return;
          }
      Severity: Minor
      Found in assets/js/jscalendar/calendar.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 mouseClickHandler has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

              mouseClickHandler: function (e) {
                  if (!e) e = window.event;
                  if (e.button > 1) return true;
                  if (!e.target) e.target = e.srcElement;
      
      
      Severity: Minor
      Found in assets/images/js/highslide/highslide-with-html.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 startElementHandler has a Cognitive Complexity of 49 (exceeds 5 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: Minor
      Found in include/patTemplate.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

      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/images/js/highslide/highslide-full.js - About 7 hrs to fix

        Function list_blocks has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

        function list_blocks()
        {
            global $query4redirect, $block_arr, $xoopsGTicket;
        
            // cachetime options
        Severity: Minor
        Found in admin/myblocksadmin.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

        Function xoops_module_update_apcal has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

        function xoops_module_update_apcal(XoopsModule $module)
        {
            //    global $xoopsDB;
            $moduleDirName = basename(dirname(__DIR__));
            $capsDirName   = strtoupper($moduleDirName);
        Severity: Minor
        Found in include/onupdate.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

        Function rrule_to_human_language has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
        Open

                public function rrule_to_human_language($rrule)
                {
                    $rrule = trim($rrule);
                    if ($rrule === '') {
                        return '';
        Severity: Minor
        Found in class/APCal.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

        Method list_blocks has 182 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function list_blocks()
        {
            global $query4redirect, $block_arr, $xoopsGTicket;
        
            // cachetime options
        Severity: Major
        Found in admin/myblocksadmin.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/images/js/highslide/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/images/js/highslide/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

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

                  public function rrule_from_post($start, $allday_flag)
                  {
                      // �����֤�̵���ʤ顢̵���Ƕ�ʸ������֤�
                      if ($_POST['rrule_freq'] === 'none') {
                          return '';
          Severity: Minor
          Found in class/APCal.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

          Method update_schedule has 178 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public function update_schedule($set_sql_append = '', $whr_sql_append = '', $notify_callback = null)
                  {
                      if ($_POST['summary'] === '') {
                          $_POST['summary'] = _APCAL_MB_NOSUBJECT;
                      }
          Severity: Major
          Found in class/APCal.php - About 7 hrs to fix

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

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

              Function Expander has a Cognitive Complexity of 45 (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/images/js/highslide/highslide.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

              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/images/js/highslide/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

              Function Expander has a Cognitive Complexity of 45 (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/images/js/highslide/highslide-with-html.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