XoopsModules25x/smallworld

View on GitHub
assets/js/smallworld.js

Summary

Maintainability
F
1 wk
Test Coverage

File smallworld.js has 1070 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * jQuery configs, selectors and functions for Xoops Smallworld
 *
 * 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
Severity: Major
Found in assets/js/smallworld.js - About 2 days to fix

    Function smallworld_DoValStart has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function smallworld_DoValStart() {
        xoops_smallworld(document).ready(function () {
            // Attact validation to registeration parts in register form
            if (smallworldvalidationstrength != 0) {
                xoops_smallworld("#smallworld_profileform-next-0").hide();
    Severity: Major
    Found in assets/js/smallworld.js - About 3 hrs to fix

      Function smallworld_getCountFriendMessagesEtcJS has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      function smallworld_getCountFriendMessagesEtcJS() {
          xoops_smallworld.ajax({
              url: smallworld_url + "Get_Count.php?SmallworldGetUserMsgCount=1" + "&rndnum=" + Math.floor(Math.random() * 101),
              cache: false,
              dataType: "json",
      Severity: Minor
      Found in assets/js/smallworld.js - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function SmallworldGetMoreMsg has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function SmallworldGetMoreMsg() {
          xoops_smallworld('.smallworld_msg_counter:last').show();
          xoops_smallworld('.smallworld_msg_counter').on('click', function (e) {
              e.preventDefault();
              xoops_smallworld('#smallworld_moremsg_ajax').show();
      Severity: Minor
      Found in assets/js/smallworld.js - About 1 hr to fix

        Function Smallworld_attachAvatarOpen has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function Smallworld_attachAvatarOpen() {
            // Open comment and update avatar imagen in new window on click
            xoops_smallworld(function () {
                xoops_smallworld('.smallworld_big_face, .smallworld_small_face, .smallworldAttImg').css('cursor', 'pointer');
                xoops_smallworld('.smallworld_big_face, .smallworld_small_face, .smallworldAttImg').on('click', function (event) {
        Severity: Minor
        Found in assets/js/smallworld.js - About 1 hr to fix

          Function smallworld_getCountFriendMessagesEtcJS has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function smallworld_getCountFriendMessagesEtcJS() {
              xoops_smallworld.ajax({
                  url: smallworld_url + "Get_Count.php?SmallworldGetUserMsgCount=1" + "&rndnum=" + Math.floor(Math.random() * 101),
                  cache: false,
                  dataType: "json",
          Severity: Minor
          Found in assets/js/smallworld.js - About 1 hr to fix

            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

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

                xoops_smallworld('#_smallworld_present_maplink').on('click', function (event) {
                    event.preventDefault();
                    if (xoops_smallworld('#_smallworld_present_map').length) { // implies *not* zero
                        if (Smallworld_geocomplete == 1) {
                            xoops_smallworld('#_smallworld_present_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 767..793

            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

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

                xoops_smallworld('#_smallworld_workmore').on('click', function (event) {
                    event.preventDefault();
                    if (xoops_smallworld('#workfull').length) { // implies *not* zero
                        xoops_smallworld('#workfull').show();
                        xoops_smallworld.colorbox({
            Severity: Major
            Found in assets/js/smallworld.js and 2 other locations - About 4 hrs to fix
            assets/js/smallworld.js on lines 711..727
            assets/js/smallworld.js on lines 730..746

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

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

                xoops_smallworld('#_SMALLWORLD_MOREINFO').on('click', function (event) {
                    event.preventDefault();
                    if (xoops_smallworld('#interestsandmore').length) { // implies *not* zero
                        xoops_smallworld('#interestsandmore').show();
                        xoops_smallworld.colorbox({
            Severity: Major
            Found in assets/js/smallworld.js and 2 other locations - About 4 hrs to fix
            assets/js/smallworld.js on lines 692..708
            assets/js/smallworld.js on lines 711..727

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

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

                xoops_smallworld('#_smallworld_educationmore').on('click', function (event) {
                    event.preventDefault();
                    if (xoops_smallworld('#educationfull').length) { // implies *not* zero
                        xoops_smallworld('#educationfull').show();
                        xoops_smallworld.colorbox({
            Severity: Major
            Found in assets/js/smallworld.js and 2 other locations - About 4 hrs to fix
            assets/js/smallworld.js on lines 692..708
            assets/js/smallworld.js on lines 730..746

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

            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 (xoops_smallworld("#birthplace").length > 0) {
                            if (typeof xoops_smallworld('#birthplace').val() != "undefined") {
                                // Additional check to not react on all input focus, check page url contains string
                                if ((window.location.href.indexOf("editprofile.php") > -1) || (window.location.href.indexOf("register.php") > -1)){
                                  xoops_smallworld('#birthplace').OsmLiveSearchBirth();
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 3 hrs to fix
            assets/js/smallworld.js on lines 288..296

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 114.

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

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

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

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

            Refactorings

            Further Reading

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

                        if (xoops_smallworld("#present_city").length > 0) {
                            if (typeof xoops_smallworld('#present_city').val() != "undefined") {
                                // Additional check to not react on all input focus, check page url contains string
                                if ((window.location.href.indexOf("editprofile.php") > -1) || (window.location.href.indexOf("register.php") > -1)){
                                    xoops_smallworld('#present_city').OsmLiveSearchNow();
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 3 hrs to fix
            assets/js/smallworld.js on lines 279..286

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 114.

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

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

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

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

            Refactorings

            Further Reading

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

                                open: function (event, ui) {
                                    xoops_smallworld("ul.ui-autocomplete li a").each(function () {
                                        var htmlString = xoops_smallworld(this).html().replace(/&lt;/g, '<');
                                        htmlString = htmlString.replace(/&gt;/g, '>');
                                        xoops_smallworld(this).html(htmlString);
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 3 hrs to fix
            assets/js/smallworld.js on lines 451..458

            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

                        open: function (event, ui) {
                            xoops_smallworld("ul.ui-autocomplete li a").each(function () {
                                var htmlString = xoops_smallworld(this).html().replace(/&lt;/g, '<');
                                htmlString = htmlString.replace(/&gt;/g, '>');
                                xoops_smallworld(this).html(htmlString);
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 3 hrs to fix
            assets/js/smallworld.js on lines 416..423

            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

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

                xoops_smallworld('#screennameAdd').on('click', function (e) {
                    e.preventDefault();
                    xoops_smallworld('span#screenname:last').clone(true).insertBefore(this).find('input').val('');
                    xoops_smallworld('span#screennameremove:last').clone(true).insertBefore(this);
                });
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 3 hrs to fix
            assets/js/smallworld.js on lines 549..553

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

            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('#schoolAdd').on('click', function (e) {
                    e.preventDefault();
                    xoops_smallworld('div#school:last').clone(true).insertBefore(this).find('input').val('');
                    xoops_smallworld('span#schoolremove:last').clone(true).insertBefore(this);
                });
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 3 hrs to fix
            assets/js/smallworld.js on lines 542..546

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

            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 doMapBirth(lat, lon) {
                    var map = L.map('_smallworld_birthplace_map').setView([lat, lon], 13);
                    L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
                        attribution: '© OpenStreetMap'
                    }).addTo(map);
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 3 hrs to fix
            assets/js/smallworld.js on lines 804..811

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

            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 doMapNow(lat, lon) {
                    var map = L.map('_smallworld_present_map').setView([lat, lon], 13);
                    L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
                        attribution: '© OpenStreetMap'
                    }).addTo(map);
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 3 hrs to fix
            assets/js/smallworld.js on lines 795..802

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

            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.colorbox({
                            width: "35%",
                            height: "50%",
                            inline: true,
                            onCleanup: function () {
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 2 hrs to fix
            assets/js/smallworld.js on lines 32..43

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

            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.colorbox({
                            width: "75%",
                            height: "28%",
                            inline: true,
                            onCleanup: function () {
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 2 hrs to fix
            assets/js/smallworld.js on lines 58..69

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

            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["ui"]["autocomplete"].prototype["_renderItem"] = function (ul, item) {
                        return xoops_smallworld("<li></li>")
                            .data("item.autocomplete", item)
                            .append(xoops_smallworld("<a></a>").html(item.label))
                            .appendTo(ul);
            Severity: Major
            Found in assets/js/smallworld.js and 1 other location - About 1 hr to fix
            assets/js/jquery-ui-1.8.11.custom.js on lines 5299..5304

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

            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 (diff > 0) {
                                var text = smallworldNewMessages + diff;
                                xoops_smallworld('#smallworld_messagecounter_id').html(text);
                                xoops_smallworld('#smallworld_messagecounter_id').show();
                                //window.location.reload();
            Severity: Minor
            Found in assets/js/smallworld.js and 1 other location - About 55 mins to fix
            assets/js/smallworld.js on lines 1163..1168

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

            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('.jobstop').removeClass("hasDatepicker").attr('id', "").datepicker({
                        changeMonth: true,
                        changeYear: true,
                        dateFormat: 'yy',
                        yearRange: '-100:+0'
            Severity: Minor
            Found in assets/js/smallworld.js and 1 other location - About 55 mins to fix
            assets/js/smallworld.js on lines 560..565

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

            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('.jobstart').removeClass("hasDatepicker").attr('id', "").datepicker({
                        changeMonth: true,
                        changeYear: true,
                        dateFormat: 'yy',
                        yearRange: '-100:+0'
            Severity: Minor
            Found in assets/js/smallworld.js and 1 other location - About 55 mins to fix
            assets/js/smallworld.js on lines 566..571

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

            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 (diff < 0) {
                                var text = smallworldDeletedMessages + diff;
                                xoops_smallworld('#smallworld_messagecounter_id').html(text);
                                xoops_smallworld('#smallworld_messagecounter_id').show();
                                //window.location.reload();
            Severity: Minor
            Found in assets/js/smallworld.js and 1 other location - About 55 mins to fix
            assets/js/smallworld.js on lines 1175..1180

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

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

                        if (xoops_smallworld.inArray('birthplace', smallworlduseverification) > -1) {
                            xoops_smallworld("#birthplace").validate({
                                expression: "if (VAL) return true; else return false;",
                                message: SmallworldValidationBirthplaceErrorMsg
                            });
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1194..1200
            assets/js/smallworld.js on lines 1202..1207
            assets/js/smallworld.js on lines 1209..1215
            assets/js/smallworld.js on lines 1217..1222
            assets/js/smallworld.js on lines 1234..1239
            assets/js/smallworld.js on lines 1248..1253
            assets/js/smallworld.js on lines 1255..1260
            assets/js/smallworld.js on lines 1262..1267

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

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

                        if (xoops_smallworld.inArray('interestedin', smallworlduseverification) > -1) {
                            xoops_smallworld("#intingender").validate({
                                expression: "if (isChecked(SelfID)) return true; else return false;",
                                message: SmallworldValidationIntingenderErrorMsg
                            });
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1194..1200
            assets/js/smallworld.js on lines 1202..1207
            assets/js/smallworld.js on lines 1217..1222
            assets/js/smallworld.js on lines 1234..1239
            assets/js/smallworld.js on lines 1241..1246
            assets/js/smallworld.js on lines 1248..1253
            assets/js/smallworld.js on lines 1255..1260
            assets/js/smallworld.js on lines 1262..1267

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

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

                        if (xoops_smallworld.inArray('birthday', smallworlduseverification) > -1) {
                            xoops_smallworld("input[name='birthday']").validate({
                                expression: "if (!isValidDate(parseInt(VAL.split('-')[2],10), parseInt(VAL.split('-')[1],10), parseInt(VAL.split('-')[0],10))) return false; else return true;",
                                message: SmallworldValidationBirthdayErrorMsg
                            });
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1194..1200
            assets/js/smallworld.js on lines 1202..1207
            assets/js/smallworld.js on lines 1209..1215
            assets/js/smallworld.js on lines 1217..1222
            assets/js/smallworld.js on lines 1241..1246
            assets/js/smallworld.js on lines 1248..1253
            assets/js/smallworld.js on lines 1255..1260
            assets/js/smallworld.js on lines 1262..1267

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

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

                        if (xoops_smallworld.inArray('realname', smallworlduseverification) > -1) {
            
                            xoops_smallworld("input#realname").validate({
                                expression: "if (VAL) return true; else return false;",
                                message: SmallworldValidationNameErrorMsg,
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1202..1207
            assets/js/smallworld.js on lines 1209..1215
            assets/js/smallworld.js on lines 1217..1222
            assets/js/smallworld.js on lines 1234..1239
            assets/js/smallworld.js on lines 1241..1246
            assets/js/smallworld.js on lines 1248..1253
            assets/js/smallworld.js on lines 1255..1260
            assets/js/smallworld.js on lines 1262..1267

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

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

                        if (xoops_smallworld.inArray('lookingfor', smallworlduseverification) > -1) {
                            xoops_smallworld("#searchrelat").validate({
                                expression: "if (isChecked(SelfID)) return true; else return false;",
                                message: SmallworldValidationSearchrelatErrorMsg
                            });
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1194..1200
            assets/js/smallworld.js on lines 1202..1207
            assets/js/smallworld.js on lines 1209..1215
            assets/js/smallworld.js on lines 1234..1239
            assets/js/smallworld.js on lines 1241..1246
            assets/js/smallworld.js on lines 1248..1253
            assets/js/smallworld.js on lines 1255..1260
            assets/js/smallworld.js on lines 1262..1267

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

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

                        if (xoops_smallworld.inArray('gender', smallworlduseverification) > -1) {
                            xoops_smallworld("select#gender").validate({
                                expression: "if (VAL != 0) return true; else return false;",
                                message: SmallworldValidationGenderErrorMsg
                            });
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1194..1200
            assets/js/smallworld.js on lines 1209..1215
            assets/js/smallworld.js on lines 1217..1222
            assets/js/smallworld.js on lines 1234..1239
            assets/js/smallworld.js on lines 1241..1246
            assets/js/smallworld.js on lines 1248..1253
            assets/js/smallworld.js on lines 1255..1260
            assets/js/smallworld.js on lines 1262..1267

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

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

                        if (xoops_smallworld.inArray('country', smallworlduseverification) > -1) {
                            xoops_smallworld("input#present_country").validate({
                                expression: "if (VAL) return true; else return false;",
                                message: SmallworldValidationCountryErrorMsg
                            });
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1194..1200
            assets/js/smallworld.js on lines 1202..1207
            assets/js/smallworld.js on lines 1209..1215
            assets/js/smallworld.js on lines 1217..1222
            assets/js/smallworld.js on lines 1234..1239
            assets/js/smallworld.js on lines 1241..1246
            assets/js/smallworld.js on lines 1248..1253
            assets/js/smallworld.js on lines 1255..1260

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

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

                        if (xoops_smallworld.inArray('presentcity', smallworlduseverification) > -1) {
                            xoops_smallworld("input#present_city").validate({
                                expression: "if (VAL) return true; else return false;",
                                message: SmallworldValidationCityErrorMsg
                            });
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1194..1200
            assets/js/smallworld.js on lines 1202..1207
            assets/js/smallworld.js on lines 1209..1215
            assets/js/smallworld.js on lines 1217..1222
            assets/js/smallworld.js on lines 1234..1239
            assets/js/smallworld.js on lines 1241..1246
            assets/js/smallworld.js on lines 1248..1253
            assets/js/smallworld.js on lines 1262..1267

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

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

                        if (xoops_smallworld.inArray('birthplace', smallworlduseverification) > -1) {
                            xoops_smallworld("input#adress").validate({
                                expression: "if (VAL) return true; else return false;",
                                message: SmallworldValidationAdressErrorMsg
                            });
            Severity: Major
            Found in assets/js/smallworld.js and 8 other locations - About 40 mins to fix
            assets/js/smallworld.js on lines 1194..1200
            assets/js/smallworld.js on lines 1202..1207
            assets/js/smallworld.js on lines 1209..1215
            assets/js/smallworld.js on lines 1217..1222
            assets/js/smallworld.js on lines 1234..1239
            assets/js/smallworld.js on lines 1241..1246
            assets/js/smallworld.js on lines 1255..1260
            assets/js/smallworld.js on lines 1262..1267

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

            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

                    buttons[_smallworldCancel] = function () {
                        xoops_smallworld(this).dialog("close");
                        location.href = smallworld_url + 'publicindex.php';
                    };
            Severity: Minor
            Found in assets/js/smallworld.js and 1 other location - About 35 mins to fix
            assets/js/smallworld.js on lines 213..216

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

            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

                    buttons[_smallworldClose] = function () {
                        xoops_smallworld(this).dialog("close");
                        location.href = smallworld_url + 'publicindex.php';
                    };
            Severity: Minor
            Found in assets/js/smallworld.js and 1 other location - About 35 mins to fix
            assets/js/smallworld.js on lines 209..212

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

            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(function () {
                    xoops_smallworld('body').on('click', '#smallworldDonate', function () {
                        window.open('https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=WKFZBRBGMYKCA&lc=DK"&item_name=Culex%2edk&item_number=culex&currency_code=DKK&bn=PP%2dDonationsBF%3asp%2epng%3aNonHosted', 'blank',
                            'width=600, height=400, menubar=no, toolbar=no, scrollbars=yes');
                    });
            Severity: Minor
            Found in assets/js/smallworld.js and 1 other location - About 35 mins to fix
            assets/js/adminsmallworld.js on lines 81..86

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

            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

            There are no issues that match your filters.

            Category
            Status