Showing 5 of 9 total issues
Function userProfile
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Strategy.prototype.userProfile = function(accessToken, done) {
var 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(accessToken, done) {
var 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 FacebookGraphAPIError
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function FacebookGraphAPIError(message, type, code, subcode, traceID) {
Function FacebookTokenError
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function FacebookTokenError(message, type, code, subcode, traceID) {
Function parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
exports.parse = function(json) {
if ('string' == typeof json) {
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"