Showing 6 of 12 total issues
Function parse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.parse = function parse(json) {
if (typeof json === 'string') {
json = JSON.parse(json);
}
- 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 parse
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
exports.parse = function parse(json) {
if (typeof json === 'string') {
json = JSON.parse(json);
}
Function userProfile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Strategy.prototype.userProfile = function userProfile(accessToken, done) {
let url = uri.parse(this._profileURL);
if (this._enableProof) {
// Secure API call by adding proof of the app secret. This is required when
// the "Require AppSecret Proof for Server API calls" setting has been
Function userProfile
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
Strategy.prototype.userProfile = function userProfile(accessToken, done) {
let url = uri.parse(this._profileURL);
if (this._enableProof) {
// Secure API call by adding proof of the app secret. This is required when
// the "Require AppSecret Proof for Server API calls" setting has been
- 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 FacebookTokenError
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function FacebookTokenError(message, type, code, subcode, traceID) {
Function FacebookGraphAPIError
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function FacebookGraphAPIError(message, type, code, subcode, traceID) {