sympmarc/SPServices

View on GitHub

Showing 105 of 105 total issues

Function SPServices has 869 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.SPServices = function (options) {

        // If there are no options passed in, use the defaults.  Extend replaces each default with the passed option.
        var opt = $.extend({}, $.fn.SPServices.defaults, options);

Severity: Major
Found in src/core/SPServices.core.js - About 4 days to fix

    File SPServices.core.js has 1182 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Original SPServices core modules...
     */
    define([
        "jquery",
    Severity: Major
    Found in src/core/SPServices.core.js - About 3 days to fix

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

      define([
          'jquery',
         //---------------------------
          // We don't need local variables for these dependencies
          // because they are added to the jQuery namespace.
      Severity: Major
      Found in src/utils/SPGetDisplayFromStatic.js and 1 other location - About 2 days to fix
      src/utils/SPGetStaticFromDisplay.js on lines 1..50

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

      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

      define([
          'jquery',
         //---------------------------
          // We don't need local variables for these dependencies
          // because they are added to the jQuery namespace.
      Severity: Major
      Found in src/utils/SPGetStaticFromDisplay.js and 1 other location - About 2 days to fix
      src/utils/SPGetDisplayFromStatic.js on lines 1..50

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

      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

                          switch (columnSelect.Type) {
                              case constants.dropdownType.simple:
                                  var selected = ($(this).attr("ows_ID") === columnSelectSelected[0]) ? " selected='selected'" : "";
                                  columnSelect.Obj.append("<option" + selected + " value='" + thisOption.id + "'>" + thisOption.value + "</option>");
                                  break;
      Severity: Major
      Found in src/value-added/SPFilterDropdown.js and 1 other location - About 1 day to fix
      src/value-added/SPCascadeDropdowns.js on lines 327..344

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

      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

                              switch (childSelect.Type) {
                                  case constants.dropdownType.simple:
                                      var selected = ($(this).attr("ows_ID") === childSelectSelected[0]) ? " selected='selected'" : "";
                                      childSelect.Obj.append("<option" + selected + " value='" + thisOption.id + "'>" + thisOption.value + "</option>");
                                      break;
      Severity: Major
      Found in src/value-added/SPCascadeDropdowns.js and 1 other location - About 1 day to fix
      src/value-added/SPFilterDropdown.js on lines 165..182

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

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

      module.exports = function(grunt) {
          require('jit-grunt')(grunt);
      
          "use strict";
      
      
      Severity: Major
      Found in Gruntfile.js - About 1 day to fix

        Function cascadeDropdown has 177 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function cascadeDropdown(parentSelect) {
                var choices = "";
                var parentSelectSelected;
                var childSelectSelected = null;
                var newMultiLookupPickerdata;
        Severity: Major
        Found in src/value-added/SPCascadeDropdowns.js - About 7 hrs to fix

          Function SPFilterDropdown has 163 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.SPServices.SPFilterDropdown = function (options) {
          
                  var opt = $.extend({}, {
                      relationshipWebURL: "", // [Optional] The name of the Web (site) which contains the relationshipList
                      relationshipList: "", // The name of the list which contains the lookup values
          Severity: Major
          Found in src/value-added/SPFilterDropdown.js - About 6 hrs to fix

            File jquery.SPServices.d.ts has 414 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            
            declare module JQuerySPServices {
                interface SPServicesOptions {
                    /** If true, we'll cache the XML results with jQuery's .data() function */
                    cacheXML?: boolean;
            Severity: Minor
            Found in src/jquery.SPServices.d.ts - About 5 hrs to fix

              Function SPScriptAudit has 134 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.SPServices.SPScriptAudit = function (options) {
              
                      var opt = $.extend({}, {
                          webURL: "", // [Optional] The name of the Web (site) to audit
                          listName: "", // [Optional] The name of a specific list to audit. If not present, all lists in the site are audited.
              Severity: Major
              Found in src/value-added/SPScriptAudit.js - About 5 hrs to fix

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

                    function lookupMultiToJsonObject(s) {
                        if (s.length === 0) {
                            return null;
                        } else {
                            var thisLookupMultiObject = [];
                Severity: Major
                Found in src/utils/SPXmlToJson.js and 1 other location - About 5 hrs to fix
                src/utils/SPXmlToJson.js on lines 208..220

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

                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 userMultiToJsonObject(s) {
                        if (s.length === 0) {
                            return null;
                        } else {
                            var thisUserMultiObject = [];
                Severity: Major
                Found in src/utils/SPXmlToJson.js and 1 other location - About 5 hrs to fix
                src/utils/SPXmlToJson.js on lines 234..246

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

                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

                                $(xData.responseXML).find("errorstring").each(function () {
                                    var errorText = $(this).text();
                                    if (opt.debug && errorText === "One or more field types are not installed properly. Go to the list settings page to delete these fields.") {
                                        utils.errBox(thisFunction,
                                            "relatedListColumn: " + opt.relatedListColumn,
                Severity: Major
                Found in src/value-added/SPDisplayRelatedInfo.js and 1 other location - About 5 hrs to fix
                src/value-added/SPFilterDropdown.js on lines 102..114

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

                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

                                $(xData.responseXML).find("errorstring").each(function () {
                                    var errorText = $(this).text();
                                    if (opt.debug && errorText === "One or more field types are not installed properly. Go to the list settings page to delete these fields.") {
                                        utils.errBox(thisFunction,
                                            "relationshipListColumn: " + opt.relationshipListColumn,
                Severity: Major
                Found in src/value-added/SPFilterDropdown.js and 1 other location - About 5 hrs to fix
                src/value-added/SPDisplayRelatedInfo.js on lines 180..192

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

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

                    $.fn.SPServices.SPAutocomplete = function (options) {
                
                        var opt = $.extend({}, {
                            webURL: "", // [Optional] The name of the Web (site) which contains the sourceList
                            sourceList: "", // The name of the list which contains the values
                Severity: Major
                Found in src/value-added/SPAutocomplete.js - About 5 hrs to fix

                  Function showRelated has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function showRelated(opt, relatedListXML, relatedColumnsXML) {
                  
                          var i;
                          var columnSelectSelected;
                          var thisFunction = "SPServices.SPDisplayRelatedInfo";
                  Severity: Major
                  Found in src/value-added/SPDisplayRelatedInfo.js - About 4 hrs to fix

                    Function completefunc has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    completefunc: function (xData) {
                    
                                        // Handle errors
                                        $(xData.responseXML).find("errorstring").each(function () {
                                            var thisFunction = "SPServices.SPCascadeDropdowns";
                    Severity: Major
                    Found in src/value-added/SPCascadeDropdowns.js - About 4 hrs to fix

                      Function SPCascadeDropdowns has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          $.fn.SPServices.SPCascadeDropdowns = function (options) {
                      
                              var opt = $.extend({}, {
                                  relationshipWebURL: "", // [Optional] The name of the Web (site) which contains the relationships list
                                  relationshipList: "", // The name of the list which contains the parent/child relationships
                      Severity: Major
                      Found in src/value-added/SPCascadeDropdowns.js - About 4 hrs to fix

                        Function showColumn has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function showColumn(listXML, columnXML, columnValue, opt) {
                        
                                if (typeof columnValue === "undefined") {
                                    return "";
                                }
                        Severity: Major
                        Found in src/value-added/SPDisplayRelatedInfo.js - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language