sympmarc/SPServices

View on GitHub

Showing 105 of 105 total issues

Function SPSetMultiSelectSizes has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.SPServices.SPSetMultiSelectSizes = function (options) {

        var opt = $.extend({}, {
            listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context.
            multiSelectColumn: "",
Severity: Minor
Found in src/value-added/SPSetMultiSelectSizes.js - About 1 hr to fix

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

                    completefunc: function (xData) {
                        $(xData.responseXML).find("List").each(function () {
                            listXml = $(this);
    
                            // If listName has been specified, then only return results for that list
    Severity: Minor
    Found in src/value-added/SPScriptAudit.js - About 1 hr to fix

      Function SPRedirectWithID has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          $.fn.SPServices.SPRedirectWithID = function (options) {
      
              var opt = $.extend({}, {
                  redirectUrl: "", // Page for the redirect
                  qsParamName: "ID" // In some cases, you may want to pass the newly created item's ID with a different
      Severity: Minor
      Found in src/value-added/SPRedirectWithID.js - About 1 hr to fix

        Function SPScriptAuditPage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function SPScriptAuditPage(opt, listXml, pageClass, pageType, pageUrl) {
        
                var jQueryPage = 0;
                var pageScriptSrc = {};
                pageScriptSrc.type = [];
        Severity: Minor
        Found in src/value-added/SPScriptAudit.js - About 1 hr to fix

          Function SPGetLastItemId has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              $.fn.SPServices.SPGetLastItemId = function (options) {
          
                  var opt = $.extend({}, {
                      webURL: "", // URL of the target Web.  If not specified, the current Web is used.
                      listName: "", // The name or GUID of the list
          Severity: Minor
          Found in src/utils/SPGetLastItemId.js - About 1 hr to fix

            Function exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function(current, target, breadcrumbs) {
            
              var className = '';
            
              if (!current || !target){
            Severity: Minor
            Found in docs/layouts/helpers/is_active_with_ancestor.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

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

                                            outString += "<td class='" + opt.rowCSSClass + "'>" + showColumn(relatedListXML, relatedColumnsXML[opt.relatedColumns[i]], $(this).attr("ows_" + opt.relatedColumns[i]), opt) + "</td>";
            Severity: Major
            Found in src/value-added/SPDisplayRelatedInfo.js and 1 other location - About 1 hr to fix
            src/value-added/SPDisplayRelatedInfo.js on lines 230..230

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

            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

                                            outString += "<td class='" + opt.rowCSSClass + "'>" + showColumn(relatedListXML, relatedColumnsXML[opt.relatedColumns[i]], $(this).attr("ows_" + opt.relatedColumns[i]), opt) + "</td>";
            Severity: Major
            Found in src/value-added/SPDisplayRelatedInfo.js and 1 other location - About 1 hr to fix
            src/value-added/SPDisplayRelatedInfo.js on lines 213..213

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 70.

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

                $.fn.SPServices.SPDropdownCtl = function (options) {
            
                    var opt = $.extend({}, {
                        displayName: "" // The displayName of the column on the form
                    }, options);
            Severity: Minor
            Found in src/utils/SPDropdownCtl.js - About 1 hr to fix

              Function SPDebugXMLHttpResult has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.SPServices.SPDebugXMLHttpResult = function (options) {
              
                      var opt = $.extend({}, {
                          node: null, // An XMLHttpResult object from an ajax call
                          indent: 0 // Number of indents
              Severity: Minor
              Found in src/utils/SPDebugXMLHttpResult.js - About 1 hr to fix

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

                        SPGetStaticFromDisplay(options: {
                            /**
                             * [Optional] The URL of the Web (site) which contains the listName. If not specified, the current site is used. 
                             * Examples would be: "/", "/Accounting", "/Departments/HR", etc. Note: It's always best to use relative URLs.
                             */
                Severity: Major
                Found in src/jquery.SPServices.d.ts and 1 other location - About 1 hr to fix
                src/jquery.SPServices.d.ts on lines 1248..1266

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

                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

                        SPGetDisplayFromStatic(options: {
                            /**
                             * [Optional] The URL of the Web (site) which contains the listName. If not specified, the current site is used. 
                             * Examples would be: "/", "/Accounting", "/Departments/HR", etc. Note: It's always best to use relative URLs.
                             */
                Severity: Major
                Found in src/jquery.SPServices.d.ts and 1 other location - About 1 hr to fix
                src/jquery.SPServices.d.ts on lines 1411..1429

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

                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

                    banner      = "/*\n" +
                        "* <%= pkg.name %> - <%= pkg.description_short %>\n" +
                        "* Version <%= pkg.version %>\n" +
                        "* @requires <%= pkg.requires %>\n" +
                        "*\n" +
                Severity: Major
                Found in Gulpfile.js and 1 other location - About 1 hr to fix
                Gruntfile.js on lines 15..32

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

                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

                                        var thisValueTest = opt.ignoreCase ? $(this).attr("ows_" + opt.sourceColumn).toUpperCase() : $(this).attr("ows_" + opt.sourceColumn);
                Severity: Major
                Found in src/value-added/SPAutocomplete.js and 1 other location - About 1 hr to fix
                src/value-added/SPRequireUnique.js on lines 69..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 66.

                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

                    banner      = "/*\n" +
                        "* <%= pkg.name %> - <%= pkg.description_short %>\n" +
                        "* Version <%= pkg.version %>\n" +
                        "* @requires <%= pkg.requires %>\n" +
                        "*\n" +
                Severity: Major
                Found in Gruntfile.js and 1 other location - About 1 hr to fix
                Gulpfile.js on lines 46..64

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

                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

                                        var thisValue = opt.ignoreCase ? $(this).attr("ows_" + opt.columnStaticName).toUpperCase() : $(this).attr("ows_" + opt.columnStaticName);
                Severity: Major
                Found in src/value-added/SPRequireUnique.js and 1 other location - About 1 hr to fix
                src/value-added/SPAutocomplete.js on lines 116..116

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

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

                    $.fn.SPServices.SPComplexToSimpleDropdown = function (options) {
                
                        var opt = $.extend({}, {
                            listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context.
                            columnName: "", // The display name of the column in the form
                Severity: Minor
                Found in src/value-added/SPComplexToSimpleDropdown.js - About 1 hr to fix

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

                      QUnit.test("SPGetCurrentSite", function (assert) {
                          var currentSite = $().SPServices.SPGetCurrentSite();
                          assert.ok(currentSite !== undefined, "Passed! SPCurrentSite =::" + currentSite + "::");
                      });
                  Severity: Major
                  Found in test/general.js and 3 other locations - About 1 hr to fix
                  test/general.js on lines 18..21
                  test/general.js on lines 23..26
                  test/general.js on lines 28..31

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                      QUnit.test("Version", function (assert) {
                          var v = $().SPServices.Version();
                          assert.ok(v !== undefined, "Passed! Ver =::" + v + "::");
                      });
                  Severity: Major
                  Found in test/general.js and 3 other locations - About 1 hr to fix
                  test/general.js on lines 23..26
                  test/general.js on lines 28..31
                  test/general.js on lines 33..36

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                      QUnit.test("SPGetQueryString", function (assert) {
                          var qs = $().SPServices.SPGetQueryString();
                          assert.ok(qs !== undefined, "Passed! SPGetQueryString =::" + qs + "::");
                      });
                  Severity: Major
                  Found in test/general.js and 3 other locations - About 1 hr to fix
                  test/general.js on lines 18..21
                  test/general.js on lines 28..31
                  test/general.js on lines 33..36

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

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

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

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

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

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language