Showing 371 of 463 total issues
Function cacheFactory
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cacheFactory(cacheId, options) {
if (cacheId in caches) {
throw Error('cacheId ' + cacheId + ' taken');
}
Function FormController
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FormController(element, attrs) {
var form = this,
parentForm = element.parent().controller('form') || nullFormCtrl,
invalidCount = 0, // used to easily determine if we are valid
errors = form.$error = {};
Function add
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function( elem, types, handler, data, selector ) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Function matcherFromGroupMatchers
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
// A counter to specify which element is currently being matched
var matcherCachedRuns = 0,
bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
File controllers.js
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/**
* Network Tab Controller.
*/
(function(ng, $) {
Function tokenizeFormatString
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Open
String.tokenizeFormatString = function(format, formatters)
{
var tokens = [];
var substitutionIndex = 0;
- 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 ngRepeatWatch
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
scope.$watch(function ngRepeatWatch(scope){
var index, length,
collection = scope.$eval(rhs),
cursor = iterStartElement, // current position of the node
// Same as lastOrder but it has the current state. It will become the
Function done
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function done( status, nativeStatusText, responses, headers ) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Called once
Function has
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function has(name) {
if (name == "bug-string-char-index") {
// IE <= 7 doesn't support accessing string characters using square
// bracket notation. IE 8 only supports this for primitives.
return "a"[0] != "a";
Consider simplifying this complex logical expression. Open
Open
if (
hour < (
minute > 0 || second > 0 || millisecond > 0 ?
24 : 25
) &&
File es5-sham.js
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// Copyright 2009-2012 by contributors, MIT License
// vim: ts=4 sts=4 sw=4 expandtab
// Module systems magic dance
(function (definition) {
Function ngModule
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ngModule($provide) {
$provide.provider('$compile', $CompileProvider).
directive({
a: htmlAnchorDirective,
input: inputDirective,
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
Function updateRoute
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function updateRoute() {
var next = parseRoute(),
last = $route.current;
if (next && last && next.$$route === last.$$route
Function createInternalInjector
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createInternalInjector(cache, factory) {
function getService(serviceName) {
if (typeof serviceName !== 'string') {
throw Error('Service name expected');
Function superMatcher
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
superMatcher = function( seed, context, xml, results, expandContext ) {
var elem, j, matcher,
setMatched = [],
matchedCount = 0,
i = "0",
Function $digest
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$digest: function() {
var watch, value, last,
watchers,
asyncQueue,
length,
Function compileTemplateUrl
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function compileTemplateUrl(directives, beforeTemplateNodeLinkFn, $compileNode, tAttrs,
$rootElement, replace, childTranscludeFn) {
var linkQueue = [],
afterTemplateNodeLinkFn,
afterTemplateChildLinkFn,
Function Deferred
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Deferred: function( func ) {
var tuples = [
// action, add listener, listener list, final state
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
Function getLibrary
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getLibrary(exports, path) {
// Normalize paths.
path = path.replace(/\.js$/, '') + '.js';
if (isNode) {
// Use Node's `vm` module.