XoopsModules25x/apcal

View on GitHub

Showing 26,336 of 26,336 total issues

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

            try {
                this.content.style.cursor = 'default';
                this.changeSize(
                    0, {
                        wrapper: {
Severity: Major
Found in assets/images/js/highslide/highslide.js and 1 other location - About 1 day to fix
assets/images/js/highslide/highslide-with-gallery.js on lines 2088..2108

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

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

        undim: function (key) {
            if (!hs.dimmer) return;
            if (typeof key != 'undefined') hs.dimmer.owner = hs.dimmer.owner.replace('|' + key, '');

            if (
Severity: Major
Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 1 day to fix
assets/images/js/highslide/highslide-with-gallery.js on lines 411..424

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

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

        undim: function (key) {
            if (!hs.dimmer) return;
            if (typeof key != 'undefined') hs.dimmer.owner = hs.dimmer.owner.replace('|' + key, '');

            if (
Severity: Major
Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 1 day to fix
assets/images/js/highslide/highslide-full.js on lines 554..567

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

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

            try {
                this.content.style.cursor = 'default';
                this.changeSize(
                    0, {
                        wrapper: {
Severity: Major
Found in assets/images/js/highslide/highslide-with-gallery.js and 1 other location - About 1 day to fix
assets/images/js/highslide/highslide.js on lines 1587..1607

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

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

} elseif (isset($_POST['delete'])) {

    // Ticket Check
    if (!$xoopsGTicket->check()) {
        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
Severity: Major
Found in admin/admission.php and 1 other location - About 1 day to fix
admin/events.php on lines 120..213

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

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

if (isset($_POST['delete'])) {

    // Ticket Check
    if (!$xoopsGTicket->check()) {
        redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors());
Severity: Major
Found in admin/events.php and 1 other location - About 1 day to fix
admin/admission.php on lines 116..143

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

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

Calendar.prototype.create = function (_par) {
    var parent = null;
    if (!_par) {
        // default parent is the document body, in which case we create
        // a popup calendar.
Severity: Major
Found in assets/js/jscalendar/calendar.js - About 1 day to fix

    Method parse has 210 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function parse($filename, $calendar_name)
        {
            $ifile = @fopen($filename, 'r');
            if ($ifile === false) {
                return "-1: File cannot open. filename: $filename";
    Severity: Major
    Found in class/iCal_parser.php - About 1 day to fix

      Method rrule_to_form has 210 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public function rrule_to_form($rrule, $until_init)
              {
                  // �ƽ���ͤ�����
                  $norrule_checked       = '';
                  $daily_checked         = '';
      Severity: Major
      Found in class/APCal.php - About 1 day to fix

        phpthumb has 58 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class phpthumb
        {
        
            // public:
            // START PARAMETERS (for object mode and phpThumb.php)
        Severity: Major
        Found in thumbs/phpthumb.class.php - About 1 day to fix

          Function Rotate has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
          Open

              public function Rotate()
              {
                  if ($this->ra || $this->ar) {
                      if (!function_exists('ImageRotate')) {
                          $this->DebugMessage('!function_exists(ImageRotate)', __FILE__, __LINE__);
          Severity: Minor
          Found in thumbs/phpthumb.class.php - About 1 day to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

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

                  getPageSize: function () {
                      var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat'
                              ? d.documentElement : d.body,
                          ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
          
          
          Severity: Major
          Found in assets/images/js/highslide/highslide-with-gallery.js and 3 other locations - About 1 day to fix
          assets/images/js/highslide/highslide-full.js on lines 298..313
          assets/images/js/highslide/highslide-with-html.js on lines 248..263
          assets/images/js/highslide/highslide.js on lines 187..202

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 199.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                  getPageSize: function () {
                      var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat'
                              ? d.documentElement : d.body,
                          ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
          
          
          Severity: Major
          Found in assets/images/js/highslide/highslide-with-html.js and 3 other locations - About 1 day to fix
          assets/images/js/highslide/highslide-full.js on lines 298..313
          assets/images/js/highslide/highslide-with-gallery.js on lines 252..267
          assets/images/js/highslide/highslide.js on lines 187..202

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 199.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                  getPageSize: function () {
                      var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat'
                              ? d.documentElement : d.body,
                          ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
          
          
          Severity: Major
          Found in assets/images/js/highslide/highslide.js and 3 other locations - About 1 day to fix
          assets/images/js/highslide/highslide-full.js on lines 298..313
          assets/images/js/highslide/highslide-with-gallery.js on lines 252..267
          assets/images/js/highslide/highslide-with-html.js on lines 248..263

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

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                  getPageSize: function () {
                      var d = document, w = window, iebody = d.compatMode && d.compatMode != 'BackCompat'
                              ? d.documentElement : d.body,
                          ieLt9 = hs.ie && (hs.uaVersion < 9 || typeof pageXOffset == 'undefined');
          
          
          Severity: Major
          Found in assets/images/js/highslide/highslide-full.js and 3 other locations - About 1 day to fix
          assets/images/js/highslide/highslide-with-gallery.js on lines 252..267
          assets/images/js/highslide/highslide-with-html.js on lines 248..263
          assets/images/js/highslide/highslide.js on lines 187..202

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 199.

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

          function list_blockinstances()
          {
              global $query4redirect, $block_arr, $xoopsGTicket;
          
              $myts = MyTextSanitizer::getInstance();
          Severity: Major
          Found in admin/myblocksadmin2.php - About 1 day to fix

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

            while (list($title, $blog_id, $server_time, $entry_num) = $db->fetchRow($result)) {
                $user_time = $server_time + $tzoffset_s2u;
                $entry_num = ($entry_num > 1) ? $entry_num . 'entries' : $entry_num . 'entry';
                //        if( date( 'n' , $user_time ) != $this->month ) continue ;
                $target_date = date('j', $user_time);
            Severity: Major
            Found in plugins/weekly/weblog-date.php and 1 other location - About 1 day to fix
            plugins/daily/weblog-date.php on lines 73..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 247.

            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

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

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

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

                    public function get_monthly_html($get_target = '', $query_string = '', $for_print = false)
                    {
                        $tpl = new XoopsTpl();
            
                        // Set days width
            Severity: Major
            Found in class/APCal.php - About 1 day to fix

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

                          if (op !== null) {
                              if (op != 2)hs.removeEventListener(document, window.opera ? 'keypress' : 'keydown', hs.keyHandler);
                              if (!hs.enableKeyListener) return true;
              
                              if (e.preventDefault) e.preventDefault();
              Severity: Major
              Found in assets/images/js/highslide/highslide-full.js and 1 other location - About 1 day to fix
              assets/images/js/highslide/highslide-with-gallery.js on lines 488..505

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

              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