Showing 12 of 14 total issues
Function getFeed
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
var getFeed = function(params, auth, query, cb) {
var visibility = "public";
var projection = "values";
var options = {
- 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 Row
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
var Row = function(data) {
Object.keys(data).forEach(function(key) {
var val;
val = data[key];
if(key.substring(0, 4) === "gsx:") {
- 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
File spreadsheets.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
"use strict";
var axios = require("axios");
var statuses = require("statuses");
var querystring = require("querystring");
Function getFeed
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getFeed = function(params, auth, query, cb) {
var visibility = "public";
var projection = "values";
var options = {
Function rows
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spreadsheets.rows = function(opts, cb) {
if(!opts) {
throw new Error("Invalid arguments.");
}
if(!opts.key) {
Function cells
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Spreadsheets.cells = function(opts, cb) {
if(!opts) {
throw new Error("Invalid arguments.");
}
if(!opts.key) {
Function Row
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Row = function(data) {
Object.keys(data).forEach(function(key) {
var val;
val = data[key];
if(key.substring(0, 4) === "gsx:") {
Function cells
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Spreadsheets.cells = function(opts, cb) {
if(!opts) {
throw new Error("Invalid arguments.");
}
if(!opts.key) {
- 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 rows
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Spreadsheets.rows = function(opts, cb) {
if(!opts) {
throw new Error("Invalid arguments.");
}
if(!opts.key) {
- 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
Avoid too many return
statements within this function. Open
return cb(new Error("HTTP error " + response.status + ": " + statuses[response.status]));
Avoid too many return
statements within this function. Open
return cb(new Error("Invalid authorization key."));
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Spreadsheets = module.exports = function(opts, cb) {
if(!opts) {
throw new Error("Invalid arguments.");
}
if(!opts.key) {
- 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"