XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

function gif_outputAsPng($gif, $lpszFileName, $bgColor = -1)
{
    if (!isset($gif) || (@get_class($gif) <> 'cgif') || !$gif->loaded() || ($lpszFileName == '')) {
        return false;
    }
Severity: Major
Found in thumbs/phpthumb.gif.php and 1 other location - About 5 hrs to fix
thumbs/phpthumb.gif.php on lines 82..101

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

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

function gif_outputAsBmp($gif, $lpszFileName, $bgColor = -1)
{
    if (!isset($gif) || (@get_class($gif) <> 'cgif') || !$gif->loaded() || ($lpszFileName == '')) {
        return false;
    }
Severity: Major
Found in thumbs/phpthumb.gif.php and 1 other location - About 5 hrs to fix
thumbs/phpthumb.gif.php on lines 111..130

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

Function crossfade has 128 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        crossfade: function (up, to, from) {
            if (!up) return;
            var exp = this,
                last = this.last,
                x = this.x,
Severity: Major
Found in assets/images/js/highslide/highslide-full.js - About 5 hrs to fix

    File mytplsadmin.php has 379 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/mytplsadmin.php - About 5 hrs to fix

      Function justify has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

              justify: function (p, moveOnly) {
                  var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
      
                  var hasMovedMin = false;
      
      
      Severity: Minor
      Found in assets/images/js/highslide/highslide.js - About 5 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 changeSize has a Cognitive Complexity of 34 (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.js - About 5 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 diff has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          public function diff($from_lines, $to_lines)
          {
              $n_from = count($from_lines);
              $n_to   = count($to_lines);
      
      
      Severity: Minor
      Found in include/Text_Diff.php - About 5 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 4 locations. Consider refactoring.
      Open

              addEventListener: function (el, event, func) {
                  if (el == document && event == 'ready') {
                      hs.push(hs.onReady, func);
                  }
                  try {
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 5 hrs to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 677..691
      assets/images/js/highslide/highslide-with-html.js on lines 675..689
      assets/images/js/highslide/highslide.js on lines 513..527

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

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

              addEventListener: function (el, event, func) {
                  if (el == document && event == 'ready') {
                      hs.push(hs.onReady, func);
                  }
                  try {
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 5 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 852..866
      assets/images/js/highslide/highslide-with-gallery.js on lines 677..691
      assets/images/js/highslide/highslide.js on lines 513..527

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

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

              addEventListener: function (el, event, func) {
                  if (el == document && event == 'ready') {
                      hs.push(hs.onReady, func);
                  }
                  try {
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 5 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 852..866
      assets/images/js/highslide/highslide-with-html.js on lines 675..689
      assets/images/js/highslide/highslide.js on lines 513..527

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

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

              addEventListener: function (el, event, func) {
                  if (el == document && event == 'ready') {
                      hs.push(hs.onReady, func);
                  }
                  try {
      Severity: Major
      Found in assets/images/js/highslide/highslide.js and 3 other locations - About 5 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 852..866
      assets/images/js/highslide/highslide-with-gallery.js on lines 677..691
      assets/images/js/highslide/highslide-with-html.js on lines 675..689

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

      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

                  switch (e.keyCode) {
                      case 70: // f
                          if (exp) exp.doFullExpand();
                          return true;
                      case 32: // Space
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 5 hrs to fix
      assets/images/js/highslide/highslide-full.js on lines 610..631

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

      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

                  switch (e.keyCode) {
                      case 70: // f
                          if (exp) exp.doFullExpand();
                          return true;
                      case 32: // Space
      Severity: Major
      Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 5 hrs to fix
      assets/images/js/highslide/highslide-with-gallery.js on lines 466..487

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

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

              crossfade: function (up, to, from) {
                  if (!up) return;
                  var exp = this,
                      last = this.last,
                      x = this.x,
      Severity: Major
      Found in assets/images/js/highslide/highslide-with-gallery.js - About 4 hrs to fix

        Function dragHandler has a Cognitive Complexity of 33 (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-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 justify has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

                justify: function (p, moveOnly) {
                    var tgtArr, tgt = p.target, dim = p == this.x ? 'x' : 'y';
        
                    var hasMovedMin = false;
        
        
        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 get_minical_ex has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

                public function get_minical_ex($gifaday = 2, $just1gif = 0, $plugins = array())
                {
                    $db   = XoopsDatabaseFactory::getDatabaseConnection();
                    $myts = MyTextSanitizer::getInstance();
        
        
        Severity: Minor
        Found in class/APCal_xoops.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 get_mini_calendar_html has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

                public function get_mini_calendar_html($get_target = '', $query_string = '', $mode = '')
                {
                    // �¹Ի��ַ�¬��������
                    // list( $usec , $sec ) = explode( " " , microtime() ) ;
                    // $apcalstarttime = $sec + $usec ;
        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 LZWCommand has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

            public function LZWCommand(&$data, $bInit)
            {
                if ($bInit) {
                    $this->SetCodeSize = ord($data{0});
                    $data              = substr($data, 1);
        Severity: Minor
        Found in thumbs/phpthumb.gif.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

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

        while (list($title, $blog_id, $server_time) = $db->fetchRow($result)) {
            $user_time = $server_time + $tzoffset_s2u;
            //        if( date( 'n' , $user_time ) != $this->month ) continue ;
            $target_date = date('j', $user_time);
            $tmp_array   = array(
        Severity: Major
        Found in plugins/daily/weblog-blogid.php and 1 other location - About 4 hrs to fix
        plugins/weekly/weblog-blogid.php on lines 74..95

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

        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