mambax7/extcal

View on GitHub

Showing 1,163 of 1,163 total issues

Function keyHandler has 45 lines of code (exceeds 25 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 1 hr to fix

    Function init has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            init: function () {
                if (!hs.container) {
    
                    hs.ieLt7 = hs.ie && hs.uaVersion < 7;
                    hs.ieLt9 = hs.ie && hs.uaVersion < 9;
    Severity: Minor
    Found in assets/js/highslide.js - About 1 hr to fix

      Method xoops_module_update_extcal has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function xoops_module_update_extcal(\XoopsModule $xoopsModule, $previousVersion = null)
      {
          $helper     = Helper::getInstance();
          $newVersion = $helper->getModule()->getVar('version') * 100;
          if ($newVersion == $previousVersion) {
      Severity: Minor
      Found in include/update_function.php - About 1 hr to fix

        Method create has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function create($type, $y = 2000, $m = 1, $d = 1, $h = 0, $i = 0, $s = 0)
            {
                $firstDay = defined('CALENDAR_FIRST_DAY_OF_WEEK') ? CALENDAR_FIRST_DAY_OF_WEEK : 1;
                switch ($type) {
                    case 'Day':
        Severity: Minor
        Found in class/pear/Calendar/Factory.php - About 1 hr to fix

          Function run has 44 lines of code (exceeds 25 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/js/highslide-full.js - About 1 hr to fix

            Function dim has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                    dim: function (exp) {
                        if (!hs.dimmer) {
                            isNew = true;
                            hs.dimmer = hs.createElement('div', {
                                className: 'highslide-dimming highslide-viewport-size',
            Severity: Minor
            Found in assets/js/highslide-full.js - About 1 hr 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 htmlPrepareClose has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                    htmlPrepareClose: function () {
                        if (hs.geckoMac) { // bad redraws
                            if (!hs.mask) hs.mask = hs.createElement('div', null,
                                {position: 'absolute'}, hs.container);
                            hs.setStyles(hs.mask, {
            Severity: Minor
            Found in assets/js/highslide-full.js - About 1 hr 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 PclTarCreate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                function PclTarCreate($p_tarname, $p_filelist = '', $p_mode = '', $p_add_dir = '', $p_remove_dir = '')
                {
                    TrFctStart(__FILE__, __LINE__, 'PclTarCreate', "tar=$p_tarname, file='$p_filelist', mode=$p_mode, add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
                    $v_result = 1;
            
            
            Severity: Minor
            Found in class/pcltar.lib.php - About 1 hr 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 PclTraceAction has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                function PclTraceAction($p_entry)
                {
                    global $g_pcl_trace_level;
                    global $g_pcl_trace_mode;
                    global $g_pcl_trace_filename;
            Severity: Minor
            Found in class/pcltrace.lib.php - About 1 hr 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

                            if (!this[type] && !this[type + 'Text'] && this[type + 'Eval']) try {
                                s = eval(this[type + 'Eval']);
                            } catch (e) {
                            }
            Severity: Major
            Found in assets/js/highslide.js and 2 other locations - About 1 hr to fix
            assets/js/highslide-full.js on lines 2446..2449
            assets/js/highslide-with-gallery.js on lines 1941..1944

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

            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

                            if (!this[type] && !this[type + 'Text'] && this[type + 'Eval']) try {
                                s = eval(this[type + 'Eval']);
                            } catch (e) {
                            }
            Severity: Major
            Found in assets/js/highslide-with-gallery.js and 2 other locations - About 1 hr to fix
            assets/js/highslide-full.js on lines 2446..2449
            assets/js/highslide.js on lines 1447..1450

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

            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

                            if (!this[type] && !this[type + 'Text'] && this[type + 'Eval']) try {
                                s = eval(this[type + 'Eval']);
                            } catch (e) {
                            }
            Severity: Major
            Found in assets/js/highslide-full.js and 2 other locations - About 1 hr to fix
            assets/js/highslide-with-gallery.js on lines 1941..1944
            assets/js/highslide.js on lines 1447..1450

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

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

                    contentLoaded: function () {
                        try {
                            if (!this.content) return;
                            this.content.onload = null;
                            if (this.onLoadStarted) return;
            Severity: Minor
            Found in assets/js/highslide.js - About 1 hr to fix

              Method checkVerModule has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function checkVerModule($helper, $source = 'github', $default = 'master')
                  {
                      $moduleDirName      = \basename(\dirname(__DIR__, 2));
                      $moduleDirNameUpper = mb_strtoupper($moduleDirName);
                      $update             = '';
              Severity: Minor
              Found in class/Common/VersionChecks.php - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if (!hs.container) {
                
                                hs.ieLt7 = hs.ie && hs.uaVersion < 7;
                                hs.ieLt9 = hs.ie && hs.uaVersion < 9;
                
                
                Severity: Critical
                Found in assets/js/highslide-full.js - About 1 hr to fix

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

                  $selectedDays = [
                      new Calendar_Day(date('Y', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($xoopsUser))), date('n', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($xoopsUser))), date('j', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($xoopsUser)))),
                  ];
                  Severity: Major
                  Found in view_calendar-week.php and 1 other location - About 1 hr to fix
                  view_calendar-month.php on lines 81..83

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

                  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

                  $selectedDays = [
                      new Calendar_Day(date('Y', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($xoopsUser))), date('n', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($xoopsUser))), date('j', xoops_getUserTimestamp(time(), $timeHandler->getUserTimeZone($xoopsUser)))),
                  ];
                  Severity: Major
                  Found in view_calendar-month.php and 1 other location - About 1 hr to fix
                  view_calendar-week.php on lines 102..104

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

                  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.container = hs.createElement('div', {
                                          className: 'highslide-container'
                                      }, {
                                          position: 'absolute',
                                          left: 0,
                  Severity: Major
                  Found in assets/js/highslide-with-gallery.js and 2 other locations - About 1 hr to fix
                  assets/js/highslide-full.js on lines 925..937
                  assets/js/highslide.js on lines 585..597

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

                  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.container = hs.createElement('div', {
                                          className: 'highslide-container'
                                      }, {
                                          position: 'absolute',
                                          left: 0,
                  Severity: Major
                  Found in assets/js/highslide.js and 2 other locations - About 1 hr to fix
                  assets/js/highslide-full.js on lines 925..937
                  assets/js/highslide-with-gallery.js on lines 749..761

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

                  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.container = hs.createElement('div', {
                                          className: 'highslide-container'
                                      }, {
                                          position: 'absolute',
                                          left: 0,
                  Severity: Major
                  Found in assets/js/highslide-full.js and 2 other locations - About 1 hr to fix
                  assets/js/highslide-with-gallery.js on lines 749..761
                  assets/js/highslide.js on lines 585..597

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

                  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