Showing 37 of 52 total issues
File sinon-1.2.0.js
has 2078 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Sinon.JS 1.2.0, 2011/09/27
*
* @author Christian Johansen (christian@cjohansen.no)
*
- Create a ticketCreate a ticket
Function sinon
has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring. Open
var sinon = (function () {
var div = typeof document != "undefined" && document.createElement("div");
function isNode(obj) {
var success = false;
- Read upRead up
- Create a ticketCreate a ticket
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 FakeXMLHttpRequest
has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring. Open
sinon.FakeXMLHttpRequest = (function () {
/*jsl:ignore*/
var unsafeHeaders = {
"Accept-Charset": true,
"Accept-Encoding": true,
- Read upRead up
- Create a ticketCreate a ticket
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 clock
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
sinon.clock = (function () {
var id = 0;
function addTimer(args, recurring) {
if (args.length === 0) {
- Read upRead up
- Create a ticketCreate a ticket
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 fakeServer
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
sinon.fakeServer = (function () {
var push = [].push;
function F() {}
function create(proto) {
- Read upRead up
- Create a ticketCreate a ticket
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 FakeXMLHttpRequest
has 238 lines of code (exceeds 25 allowed). Consider refactoring. Open
sinon.FakeXMLHttpRequest = (function () {
/*jsl:ignore*/
var unsafeHeaders = {
"Accept-Charset": true,
"Accept-Encoding": true,
- Create a ticketCreate a ticket
Function expectation
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
sinon.expectation = (function () {
var slice = Array.prototype.slice;
var _invoke = sinon.spy.invoke;
function callCountInWords(callCount) {
- Create a ticketCreate a ticket
Function clock
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
sinon.clock = (function () {
var id = 0;
function addTimer(args, recurring) {
if (args.length === 0) {
- Create a ticketCreate a ticket
Function sinon
has 170 lines of code (exceeds 25 allowed). Consider refactoring. Open
var sinon = (function () {
var div = typeof document != "undefined" && document.createElement("div");
function isNode(obj) {
var success = false;
- Create a ticketCreate a ticket
Function fakeServer
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
sinon.fakeServer = (function () {
var push = [].push;
function F() {}
function create(proto) {
- Create a ticketCreate a ticket
Method pull
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def pull(dep)
required_file = nil # Make sure var is still in scope in rescue block
begin
# Loop through all the specified autorequires for the
# dependency. If there are none, use the dependency's name
- Read upRead up
- Create a ticketCreate a ticket
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 useFakeTimers
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
sinon.useFakeTimers = (function (global) {
var methods = ["Date", "setTimeout", "setInterval", "clearTimeout", "clearInterval"];
function restore() {
var method;
- Read upRead up
- Create a ticketCreate a ticket
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 Date
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Date: (function () {
var NativeDate = Date;
function ClockDate(year, month, date, hour, minute, second, ms) {
// Defensive and verbose to avoid potential harm in passing
- Create a ticketCreate a ticket
Method dead
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private def dead(activity)
base_activity_data = {
action: activity.action,
created_at: activity.created_at.to_time,
id: activity.id,
- Create a ticketCreate a ticket
Function deepEqual
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
deepEqual: function deepEqual(a, b) {
if (typeof a != "object" || typeof b != "object") {
return a === b;
}
- Create a ticketCreate a ticket
Function useFakeTimers
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
sinon.useFakeTimers = (function (global) {
var methods = ["Date", "setTimeout", "setInterval", "clearTimeout", "clearInterval"];
function restore() {
var method;
- Create a ticketCreate a ticket
Function wrapMethod
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
wrapMethod: function wrapMethod(object, property, method) {
if (!object) {
throw new TypeError("Should wrap property of object");
}
- Create a ticketCreate a ticket
Function verifyCallAllowed
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
verifyCallAllowed: function verifyCallAllowed(thisValue, args) {
if (receivedMaxCalls(this)) {
this.failed = true;
sinon.expectation.fail(this.method + " already called " + times(this.maxCalls));
}
- Create a ticketCreate a ticket
Method comments
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def comments(output)
FactData.all.sort_by(&:fact_id).each do |fact_data|
comment_sorter = lambda do |comment|
comment.created_at.utc.to_s + comment.content + comment.created_by.username
end
- Create a ticketCreate a ticket
Function setResponseBody
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
setResponseBody: function setResponseBody(body) {
if (this.readyState == FakeXMLHttpRequest.DONE) {
throw new Error("Request done");
}
- Create a ticketCreate a ticket