XoopsModules25x/smallworld

View on GitHub

Showing 1,838 of 1,838 total issues

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

                        tbody += "<td class='" +
                            ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends
                            (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months
                            ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key
                            (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ?
Severity: Major
Found in assets/js/jqueryui.min.js and 1 other location - About 1 day to fix
assets/js/jquery-ui-1.8.11.custom.js on lines 9751..9762

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

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

File UploadHandler.php has 647 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace XoopsModules\Smallworld;

/*
Severity: Major
Found in class/UploadHandler.php - About 1 day to fix

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

            if (!$error && $file->name) {
                if ('.' === $file->name[0]) {
                    $file->name = mb_substr($file->name, 1);
                }
                $file_path   = $this->upload_dir . $file->name;
    Severity: Major
    Found in class/SwUploadHandler.php and 1 other location - About 1 day to fix
    class/uploadclass.php on lines 146..172

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

    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 (!$error && $file->name) {
                if ('.' === $file->name[0]) {
                    $file->name = substr($file->name, 1);
                }
                $file_path   = $this->upload_dir . $file->name;
    Severity: Major
    Found in class/uploadclass.php and 1 other location - About 1 day to fix
    class/SwUploadHandler.php on lines 155..181

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

    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 ( data.collisionHeight > outerHeight ) {
                    // element is initially over the top of within
                    if ( overTop > 0 && overBottom <= 0 ) {
                        newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
                        position.top += overTop - newOverBottom;
    Severity: Major
    Found in assets/js/jqueryui.min.js and 1 other location - About 1 day to fix
    assets/js/jqueryui.min.js on lines 1361..1386

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

    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 ( data.collisionWidth > outerWidth ) {
                    // element is initially over the left side of within
                    if ( overLeft > 0 && overRight <= 0 ) {
                        newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
                        position.left += overLeft - newOverRight;
    Severity: Major
    Found in assets/js/jqueryui.min.js and 1 other location - About 1 day to fix
    assets/js/jqueryui.min.js on lines 1398..1423

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

    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

    File jquery.countdown.js has 617 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* http://keith-wood.name/countdown.html
       Countdown for jQuery v1.5.10.
       Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
       Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and 
       MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. 
    Severity: Major
    Found in assets/js/jquery.countdown.js - About 1 day to fix

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

                  top: function (position, data) {
                      if (data.at[1] === center) {
                          return;
                      }
                      var win = $(window),
      Severity: Major
      Found in assets/js/jquery-ui-1.8.11.custom.js and 1 other location - About 1 day to fix
      assets/js/jquery-ui-1.8.11.custom.js on lines 904..924

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

      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

                  left: function (position, data) {
                      if (data.at[0] === center) {
                          return;
                      }
                      var win = $(window),
      Severity: Major
      Found in assets/js/jquery-ui-1.8.11.custom.js and 1 other location - About 1 day to fix
      assets/js/jquery-ui-1.8.11.custom.js on lines 925..945

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

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

          $.fn.ajaxSubmit = function (options) {
              // fast fail if nothing selected (http://dev.jquery.com/ticket/2752)
              if (!this.length) {
                  log('ajaxSubmit: skipping submit process - no element selected');
                  return this;
      Severity: Major
      Found in assets/js/jquery.form.js - About 1 day to fix

        Function ajax has 240 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            ajax: function( url, options ) {
        
                // If url is an object, simulate pre-1.5 signature
                if ( typeof url === "object" ) {
                    options = url;
        Severity: Major
        Found in assets/js/jquery.min.js - About 1 day to fix

          Function _tabify has 229 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  _tabify: function (init) {
                      var self = this,
                          o = this.options,
                          fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
          
          
          Severity: Major
          Found in assets/js/jquery-ui-1.8.11.custom.js - About 1 day to fix

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

            foreach ($allusers_inspect as $data) {
                $ai['id']                    = $data['id'];
                $ai['userid']                = $data['userid'];
                $ai['username']              = $data['username'];
                $ai['realname']              = $data['realname'];
            Severity: Major
            Found in admin/useradmin.php and 1 other location - About 1 day to fix
            admin/main.php on lines 95..109

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

            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

                foreach ($allusers_inspect as $data) {
                    $ai['id']                    = $data['id'];
                    $ai['userid']                = $data['userid'];
                    $ai['username']              = $data['username'];
                    $ai['realname']              = $data['realname'];
            Severity: Major
            Found in admin/main.php and 1 other location - About 1 day to fix
            admin/useradmin.php on lines 53..67

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

            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 (element.css('position') == 'static') {
                            wrapper.css({position: 'relative'});
                            element.css({position: 'relative'});
                        } else {
                            $.extend(props, {
            Severity: Major
            Found in assets/js/jquery-ui-1.8.11.custom.js and 1 other location - About 1 day to fix
            assets/js/jqueryui.min.js on lines 15198..15219

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

            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 ( element.css( "position" ) === "static" ) {
                        wrapper.css({ position: "relative" });
                        element.css({ position: "relative" });
                    } else {
                        $.extend( props, {
            Severity: Major
            Found in assets/js/jqueryui.min.js and 1 other location - About 1 day to fix
            assets/js/jquery-ui-1.8.11.custom.js on lines 10512..10527

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

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

            setDocument = Sizzle.setDocument = function( node ) {
                var hasCompare, parent,
                    doc = node ? node.ownerDocument || node : preferredDoc;
            
                // If no document and documentElement is available, return
            Severity: Major
            Found in assets/js/jquery.min.js - About 1 day to fix

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

              jQuery(function (xoops_smallworld) {
                  xoops_smallworld.datepicker.regional['en-GB'] = {
                      closeText: 'Done', closeStatus: 'Close without changes',
                      prevText: 'Prev', prevStatus: 'Show previous month',
                      prevJumpText: '&#x3c;&#x3c;', prevJumpStatus: '',
              Severity: Major
              Found in language/english/js/jquery.ui.datepicker-language.js and 1 other location - About 1 day to fix
              language/french/js/jquery.ui.datepicker-language.js on lines 3..25

              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

              jQuery(function (xoops_smallworld) {
                  xoops_smallworld.datepicker.regional['fr-FR'] = {
                      closeText: 'Fermer', closeStatus: 'Fermer sans modifications',
                      prevText: '&#x3c;Précédent', prevStatus: 'Voir le mois dernier',
                      prevJumpText: '&#x3c;&#x3c;', prevJumpStatus: '',
              Severity: Major
              Found in language/french/js/jquery.ui.datepicker-language.js and 1 other location - About 1 day to fix
              language/english/js/jquery.ui.datepicker-language.js on lines 3..25

              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

                  xoops_smallworld('#_smallworld_birthplace_maplink').on('click', function (event) {
                      event.preventDefault();
                      if (xoops_smallworld('#_smallworld_birthplace_map').length) { // implies *not* zero
                          if (Smallworld_geocomplete == 1) {
                              xoops_smallworld('#_smallworld_birthplace_map').show();
              Severity: Major
              Found in assets/js/smallworld.js and 1 other location - About 1 day to fix
              assets/js/smallworld.js on lines 814..840

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

              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