XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

                $query = 'SELECT '
                    . $GLOBALS['xoopsDB']->prefix('users')
                    . '.uname, '
                    . $GLOBALS['xoopsDB']->prefix('apcal_ro_members')
                    . '.* FROM '
Severity: Major
Found in print.php and 1 other location - About 3 hrs to fix
ro_regonlinehandler.php on lines 1291..1307

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

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

        $query = 'SELECT '
                 . $GLOBALS['xoopsDB']->prefix('users')
                 . '.uname, '
                 . $GLOBALS['xoopsDB']->prefix('apcal_ro_members')
                 . '.* FROM '
Severity: Major
Found in ro_regonlinehandler.php and 1 other location - About 3 hrs to fix
print.php on lines 102..118

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

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

Date.parseDate = function (str, fmt) {
    var today = new Date();
    var y = 0;
    var m = -1;
    var d = 0;
Severity: Major
Found in assets/js/jscalendar/calendar.js - About 3 hrs to fix

    Function crossfade has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            crossfade: function (up, to, from) {
                if (!up) return;
                var exp = this,
                    last = this.last,
                    x = this.x,
    Severity: Minor
    Found in assets/images/js/highslide/highslide-full.js - About 3 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 ImageCreateFromFilename has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        public function ImageCreateFromFilename($filename)
        {
            // try to create GD image source directly via GD, if possible,
            // rather than buffering to memory and creating with ImageCreateFromString
            $ImageCreateWasAttempted = false;
    Severity: Minor
    Found in thumbs/phpthumb.class.php - About 3 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 getPng has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getPng($bgColor)
        {
            $out = '';
    
            if (!$this->m_bLoaded) {
    Severity: Minor
    Found in thumbs/phpthumb.gif.php - About 3 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 SafeURLread has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function SafeURLread($url, &$error, $timeout = 10, $followredirects = true)
        {
            $error = '';
    
            $parsed_url                      = phpthumb_functions::ParseURLbetter($url);
    Severity: Minor
    Found in thumbs/phpthumb.functions.php - About 3 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 rrule_from_post has 88 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public function rrule_from_post($start, $allday_flag)
            {
                // �����֤�̵���ʤ顢̵���Ƕ�ʸ������֤�
                if ($_POST['rrule_freq'] === 'none') {
                    return '';
    Severity: Major
    Found in class/APCal.php - About 3 hrs to fix

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

                  for (var i = 0; i < this.overlays.length; i++) {
                      var o = hs.$('hsId' + this.overlays[i]);
                      if (o && o.parentNode == hs.viewport && hs.getExpander(o) == this) hs.discardElement(o);
                  }
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 3 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 2915..2918

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

      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

                  for (var i = 0; i < this.overlays.length; i++) {
                      var o = hs.$('hsId' + this.overlays[i]);
                      if (o && o.parentNode == hs.viewport && hs.getExpander(o) == this) hs.discardElement(o);
                  }
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 3 hrs to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 2330..2333

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

      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

      Method LZWCommand has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function LZWCommand(&$data, $bInit)
          {
              if ($bInit) {
                  $this->SetCodeSize = ord($data{0});
                  $data              = substr($data, 1);
      Severity: Major
      Found in thumbs/phpthumb.gif.php - About 3 hrs to fix

        Method rrule_to_human_language has 86 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public function rrule_to_human_language($rrule)
                {
                    $rrule = trim($rrule);
                    if ($rrule === '') {
                        return '';
        Severity: Major
        Found in class/APCal.php - About 3 hrs to fix

          Method AntiOffsiteLinking has 86 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function AntiOffsiteLinking()
              {
                  // Optional anti-offsite hijacking of the thumbnail script
                  $allow = true;
                  if ($allow && $this->config_nooffsitelink_enabled
          Severity: Major
          Found in thumbs/phpthumb.class.php - About 3 hrs to fix

            Function writeExtendedContent has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                    writeExtendedContent: function () {
                        if (this.hasExtendedContent) return;
                        var exp = this;
                        this.body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
                        if (this.objectType == 'iframe') {
            Severity: Minor
            Found in assets/images/js/highslide/highslide-full.js - About 3 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 htmlSizeOperations has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                    htmlSizeOperations: function () {
            
                        this.setObjContainerSize(this.innerContent);
            
            
            
            Severity: Minor
            Found in assets/images/js/highslide/highslide-full.js - About 3 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 htmlSizeOperations has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                    htmlSizeOperations: function () {
            
                        this.setObjContainerSize(this.innerContent);
            
            
            
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-html.js - About 3 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 writeExtendedContent has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                    writeExtendedContent: function () {
                        if (this.hasExtendedContent) return;
                        var exp = this;
                        this.body = hs.getElementByClass(this.innerContent, 'DIV', 'highslide-body');
                        if (this.objectType == 'iframe') {
            Severity: Minor
            Found in assets/images/js/highslide/highslide-with-html.js - About 3 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 setCacheDirectory has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function setCacheDirectory()
                {
                    // resolve cache directory to absolute pathname
                    $this->DebugMessage('setCacheDirectory() starting with config_cache_directory = "' . $this->config_cache_directory . '"', __FILE__, __LINE__);
                    if (substr($this->config_cache_directory, 0, 1) == '.') {
            Severity: Minor
            Found in thumbs/phpthumb.class.php - About 3 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 RenderOutput has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function RenderOutput()
                {
                    if (!$this->useRawIMoutput && !is_resource($this->gdimg_output)) {
                        $this->DebugMessage('RenderOutput() failed because !is_resource($this->gdimg_output)', __FILE__, __LINE__);
            
            
            Severity: Minor
            Found in thumbs/phpthumb.class.php - About 3 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 ImageMagickCommandlineBase has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
            Open

                public function ImageMagickCommandlineBase()
                {
                    static $commandline = null;
                    if (is_null($commandline)) {
                        if ($this->issafemode) {
            Severity: Minor
            Found in thumbs/phpthumb.class.php - About 3 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