Showing 52 of 87 total issues
Function token
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function token(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}
- 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 code
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function code(options, issue, extend) {
if (typeof options == 'function') {
extend = issue;
issue = options;
options = undefined;
- 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 54 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(server, options, immediate, complete) {
if (typeof options == 'function') {
complete = immediate;
immediate = options;
options = undefined;
- 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 51 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(options) {
options = options || {};
var mode = options.mode || 'direct'
, fragment = options.fragment || ['token']
- 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 50 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}
- 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 48 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}
- 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 46 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}
- 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 code
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function code(options, issue, extend) {
if (typeof options == 'function') {
extend = issue;
issue = options;
options = undefined;
Function token
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function token(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}
Function exports
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(server, options, parse, complete) {
if (typeof options == 'function') {
complete = parse;
parse = options;
options = undefined;
- 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 31 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}
- 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 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(server, options, validate, immediate, complete) {
if (typeof options == 'function') {
complete = immediate;
immediate = validate;
validate = options;
Function grant
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Server.prototype.grant = function(type, phase, fn) {
if (typeof type == 'object') {
// sig: grant(mod)
var mod = type;
if (mod.request) { this.grant(mod.name, 'request', mod.request); }
- 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 authorization
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function authorization(req, res, next) {
var body = req.body || {}
, type = req.query.response_type || body.response_type;
Function exports
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(server, options, immediate, complete) {
if (typeof options == 'function') {
complete = immediate;
immediate = options;
options = undefined;
Function resume
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function resume(req, res, next) {
if (!req.oauth2) { return next(new Error('OAuth2orize requires transaction support. Did you forget oauth2orize.transactionLoader(...)?')); }
req.oauth2.user = req[userProperty];
if (res.locals) {
Function exports
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}
Function validated
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function validated(err, client, redirectURI, webOrigin) {
// Set properties *before* next()'ing due to error. The presence of a
// redirectURI being provided, even under error conditions, indicates
// that the client should be informed of the error via a redirect.
req.oauth2 = {};
Function exports
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}
Function exports
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(options, issue) {
if (typeof options == 'function') {
issue = options;
options = undefined;
}