Showing 50 of 86 total issues
File mocha.js
has 3373 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function(){
// CommonJS require()
function require(p){
Function factory
has 296 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
}('log', this, function factory(){
return function scope(global, Object, Array, prototype, __proto__){
// =====================================
Function scope
has 294 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function scope(global, Object, Array, prototype, __proto__){
// =====================================
// Private interface
// =====================================
Function JsDiff
has 290 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var JsDiff = (function() {
/*jshint maxparams: 5*/
function clonePath(path) {
return { newPos: path.newPos, components: path.components.slice(0) };
}
Function factory
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
Open
}('log', this, function factory(){
return function scope(global, Object, Array, prototype, __proto__){
// =====================================
- 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 HTML
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function HTML(runner) {
Base.call(this, runner);
var self = this
, stats = this.stats
File log.js
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
______ __ __ __
/ ____/___ / /_ ____ _____ ________ ____/ / / / ____ ____ _
/ __/ / __ \/ __ \/ __ `/ __ \/ ___/ _ \/ __ / / / / __ \/ __ `/
/ /___/ / / / / / / /_/ / / / / /__/ __/ /_/ / / /___/ /_/ / /_/ /
Function createPatch
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {
var ret = [];
ret.push('Index: ' + fileName);
ret.push('===================================================================');
Function run
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Runnable.prototype.run = function(fn){
var self = this
, start = new Date
, ctx = this.ctx
, finished
Function Markdown
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Markdown(runner) {
Base.call(this, runner);
var self = this
, stats = this.stats
Function exports
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(suite){
var suites = [suite];
suite.on('pre-require', function(context, file, mocha){
Function canonicalize
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.canonicalize = function(value, stack) {
var canonicalizedObj,
type = exports.type(value),
prop,
withStack = function withStack(value, fn) {
Function runTests
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Runner.prototype.runTests = function(suite, fn){
var self = this
, tests = suite.tests.slice()
, test;
Function exports
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(suite){
var suites = [suite];
suite.on('pre-require', function(context, file, mocha){
Function diff
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
diff: function(oldString, newString) {
// Handle the identity case (this is due to unrolling editLength == 0
if (newString === oldString) {
return [{ value: newString }];
}
Function applyPatch
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
applyPatch: function(oldStr, uniDiff) {
var diffstr = uniDiff.split('\n');
var diff = [];
var remEOFNL = false,
addEOFNL = false;
Function Spec
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Spec(runner) {
Base.call(this, runner);
var self = this
, stats = this.stats
Function Progress
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Progress(runner, options) {
Base.call(this, runner);
var self = this
, options = options || {}
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(suite){
var suites = [suite];
suite.on('pre-require', function(context, file, mocha){
Function Base
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Base(runner) {
var self = this
, stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 }
, failures = this.failures = [];