Showing 43 of 105 total issues
Function completefunc
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
completefunc: function (xData) {
// Handle errors
$(xData.responseXML).find("errorstring").each(function () {
var errorText = $(this).text();
Function SPGetCurrentUser
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPServices.SPGetCurrentUser = function (options) {
var opt = $.extend({}, {
webURL: "", // URL of the target Site Collection. If not specified, the current Web is used.
fieldName: "Name", // Specifies which field to return from the userdisp.aspx page
Function SPUpdateMultipleListItems
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPServices.SPUpdateMultipleListItems = function (options) {
var opt = $.extend({}, {
webURL: "", // [Optional] URL of the target Web. If not specified, the current Web is used.
listName: "", // The list to operate on.
Function SPArrangeChoices
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPServices.SPArrangeChoices = function (options) {
var opt = $.extend({}, {
listName: $().SPServices.SPListNameFromUrl(), // The list name for the current form
columnName: "", // The display name of the column in the form
Function SPSetMultiSelectSizes
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
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: "",
Function completefunc
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
completefunc: function (xData) {
$(xData.responseXML).find("List").each(function () {
listXml = $(this);
// If listName has been specified, then only return results for that list
Function SPRedirectWithID
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function SPScriptAuditPage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SPScriptAuditPage(opt, listXml, pageClass, pageType, pageUrl) {
var jQueryPage = 0;
var pageScriptSrc = {};
pageScriptSrc.type = [];
Function SPGetLastItemId
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function exports
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(current, target, breadcrumbs) {
var className = '';
if (!current || !target){
- Read upRead up
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 SPDropdownCtl
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPServices.SPDropdownCtl = function (options) {
var opt = $.extend({}, {
displayName: "" // The displayName of the column on the form
}, options);
Function SPDebugXMLHttpResult
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPServices.SPDebugXMLHttpResult = function (options) {
var opt = $.extend({}, {
node: null, // An XMLHttpResult object from an ajax call
indent: 0 // Number of indents
Function SPComplexToSimpleDropdown
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function success
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
success: function (xData) {
var scriptMatch;
while (scriptMatch = scriptRegex.exec(xData)) {
Function getDropdownSelected
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getDropdownSelected: function (columnSelect, matchOnId) {
var columnSelectSelected = [];
switch (columnSelect.Type) {
Function SPXmlToJson
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPXmlToJson = function (options) {
var opt = $.extend({}, {
mapping: {}, // columnName: mappedName: "mappedName", objectType: "objectType"
includeAllAttrs: false, // If true, return all attributes, regardless whether they are in the mapping
Function SPListNameFromUrl
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPServices.SPListNameFromUrl = function (options) {
var opt = $.extend({}, {
listName: "" // [Optional] Pass in the name or GUID of a list if you are not in its context. e.g., on a Web Part pages in the Pages library
}, options);
Function attrToJson
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function attrToJson(v, objectType) {
function identity(x) { return x; }
var result = {
Function SPGetStaticFromDisplay
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPServices.SPGetStaticFromDisplay = 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
Function SPGetDisplayFromStatic
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.SPServices.SPGetDisplayFromStatic = 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