Showing 7 of 42 total issues
Function testChainedCompriseProperty
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var testChainedCompriseProperty = function(description, buildChain) {
describe(description, function () {
it("should ensure body includes given json", function() {
return chakram.waitFor([
buildChain(expect(postRequest).to).json({
Function exports
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (chai, utils) {
var getCookie = function (jar, url, key) {
var cookies = jar.getCookies(url);
for(var ct = 0; ct < cookies.length; ct++) {
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (chai, utils) {
var chakram = require('./../chakram');
utils.addMethod(chai.Assertion.prototype, 'schema', function () {
Function request
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.request = function (method, url, params) {
var options = extend({
url: url,
method: method,
json: true
Function testWriteMethods
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var testWriteMethods = function (testMethod, testUrl) {
it("should support JSON requests", function () {
var json = {"num": 2,"str": "test"};
var response = testMethod(testUrl, json);
return response.then(function(resp) {
Function exports
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (chai, utils) {
var getCookie = function (jar, url, key) {
var cookies = jar.getCookies(url);
for(var ct = 0; ct < cookies.length; ct++) {
- 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 exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (chai, utils) {
utils.addMethod(chai.Assertion.prototype, 'header', function (key, expected) {
var headerValue = this._obj.response.headers[key.toLowerCase()];
- 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"