Showing 371 of 463 total issues
Function readIdent
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function readIdent() {
var ident = "",
start = index,
lastDot, peekIndex, methodName, ch;
Function CHILD
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"CHILD": function( type, what, argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
Consider simplifying this complex logical expression. Open
Open
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
outerCache = parent[ expando ] || (parent[ expando ] = {});
cache = outerCache[ type ] || [];
nodeIndex = cache[0] === dirruns && cache[1];
Function toFixed
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Number.prototype.toFixed = function (fractionDigits) {
var f, x, s, m, e, z, j, k;
// Test for NaN and round fractionDigits down
f = Number(fractionDigits);
Function support
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.support = (function( support ) {
var input = document.createElement("input"),
fragment = document.createDocumentFragment(),
div = document.createElement("div"),
select = document.createElement("select"),
Function get
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var get = function (value) {
var results, hasMembers;
if (value == "$") {
// Unexpected end of input.
abort();
Function $Browser
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
angular.mock.$Browser = function() {
var self = this;
this.isMock = true;
self.$$url = "http://server/";
Function formatNumber
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
if (isNaN(number) || !isFinite(number)) return '';
var isNegative = number < 0;
number = Math.abs(number);
Function $http
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function $http(config) {
config.method = uppercase(config.method);
var reqTransformFn = config.transformRequest || $config.transformRequest,
respTransformFn = config.transformResponse || $config.transformResponse,
Function $get
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.$get = ['$parse', function($parse) {
var startSymbolLength = startSymbol.length,
endSymbolLength = endSymbol.length;
/**
Function readInfo
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fs.readFile(path.join(__dirname, "README.md"), "utf8", function readInfo(exception, source) {
if (exception) {
console.log(exception);
} else {
// Read the project page template.
Function format
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
String.format = function(format, substitutions, formatters, initialValue, append)
{
if (!format || !substitutions || !substitutions.length)
return { formattedResult: append(initialValue, format), unusedSubstitutions: substitutions };
- 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 sendReq
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sendReq(config, reqData, reqHeaders) {
var deferred = $q.defer(),
promise = deferred.promise,
cache,
cachedResp,
Function ajaxConvert
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ajaxConvert( s, response, jqXHR, isSuccess ) {
var conv2, current, conv, tmp, prev,
converters = {},
// Work with a copy of dataTypes in case we need to modify it for conversion
dataTypes = s.dataTypes.slice();
Function cspSafeGetterFn
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cspSafeGetterFn(key0, key1, key2, key3, key4) {
return function(scope, locals) {
var pathVal = (locals && locals.hasOwnProperty(key0)) ? locals : scope,
promise;
Function $LocaleProvider
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function $LocaleProvider(){
this.$get = function() {
return {
id: 'en-us',
Function init
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init: function( selector, context, rootjQuery ) {
var match, elem;
// HANDLE: $(""), $(null), $(undefined), $(false)
if ( !selector ) {
Function compileNodes
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority) {
var linkFns = [],
nodeLinkFn, childLinkFn, directives, attrs, linkFnFound;
for(var i = 0; i < nodeList.length; i++) {
Function domManip
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
domManip: function( args, callback, allowIntersection ) {
// Flatten any nested arrays
args = core_concat.apply( [], args );
Function name
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Resource[name] = function(a1, a2, a3, a4) {
var params = {};
var data;
var success = noop;
var error = null;