Showing 11 of 24 total issues
Function serialize
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
export function serialize(name, val, options) {
const opt = { maxAge: null, ...(options || {}) }
const enc = opt.encode || encode
if (typeof enc !== 'function') {
- 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 md5cycle
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function md5cycle(x, k) {
let a = x[0],
b = x[1],
c = x[2],
d = x[3]
Function serialize
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function serialize(name, val, options) {
const opt = { maxAge: null, ...(options || {}) }
const enc = opt.encode || encode
if (typeof enc !== 'function') {
Function getAdapter
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function getAdapter(options) {
const client = await createAuth0Client(
pick(['domain', 'clientId', 'redirectUri'], options)
)
Function parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function parse(str, options) {
if (typeof str !== 'string') {
throw new TypeError('argument str must be a string')
}
- 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 hh
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function hh(a, b, c, d, x, s, t) {
Function ff
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function ff(a, b, c, d, x, s, t) {
Function gg
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function gg(a, b, c, d, x, s, t) {
Function ii
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function ii(a, b, c, d, x, s, t) {
Function cmn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function cmn(q, a, b, x, s, t) {
Function handleSignIn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function handleSignIn(client, credentials) {
const { email, phone, password, provider, scopes = [] } = credentials
const redirectTo = credentials.redirectTo ?? defaultOrigin
let result = null
- 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"