Showing 245 of 1,712 total issues
File Float_test.js
has 403 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
describe("Math/Float", function() {
"use strict";
var testCase = sc.test.testCase;
var $$ = sc.test.object;
File series-expr_test.js
has 373 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
describe("sc.lang.compiler.Parser", function() {
"use strict";
var Syntax = sc.lang.compiler.Syntax;
var Token = sc.lang.compiler.Token;
Function exports
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function(context) {
"use strict";
function getArgumentDefinition(list) {
for (var i = 0, imax = list.length; i < imax; ++i) {
- 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 generate
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generate(node, options) {
var defaultOptions = getDefaultOptions(), result, pair;
if (options != null) {
if (typeof options.indent === 'string') {
defaultOptions.format.indent.style = options.indent;
Function exports
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
"use strict";
require("./tools/strlib");
Function testCase
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sc.test.testCase = function(context, cases, opts) {
opts = opts || {};
var methodName = context.test.title;
var isClassMethod = methodName.charAt(0) === ".";
Function exports
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
"use strict";
var _ = require("underscore");
var IMPLEMENTED = true;
Function scanStringLiteral
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function scanStringLiteral() {
var str = '', quote, start, ch, code, unescaped, restore, octal = false;
quote = source[index];
assert((quote === '\'' || quote === '"'),
Function sinonChai
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
}(function sinonChai(chai, utils) {
"use strict";
var slice = Array.prototype.slice;
File rewriter_test.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
describe("sc.lang.compiler.rewriter", function() {
"use strict";
var Syntax = sc.lang.compiler.Syntax;
var Token = sc.lang.compiler.Token;
Function scanRegExp
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function scanRegExp() {
var str, ch, start, pattern, flags, value, classMarker = false, restore, terminated = false;
lookahead = null;
skipComment();
Function exports
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
"use strict";
var path = require("path");
var Mocha = require("mocha");
File Function_test.js
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
describe("Core/Function", function() {
"use strict";
var testCase = sc.test.testCase;
var $$ = sc.test.object;
File Integer.js
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
SCScript.install(function(sc) {
"use strict";
require("./SimpleNumber");
File mathlib.js
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function(sc) {
"use strict";
require("./libs");
require("./random");
Function tokenize
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tokenize(code, options) {
var toString,
token,
tokens;
Function SourceNode_toStringWithSourceMap
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
var generated = {
code: '',
line: 1,
column: 0
Function attachComments
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function attachComments(tree, providedComments, tokens) {
var comments = [], comment, len, i, cursor;
if (!tree.range) {
throw new Error('attachComments needs range information');
}
Function replace
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Controller.prototype.replace = function replace(root, visitor) {
var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
this.__initialize(root, visitor);
sentinel = {};
worklist = this.__worklist;
Function parse
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function parse(code, options) {
var program, toString;
toString = String;
if (typeof code !== 'string' && !(code instanceof String)) {