Showing 51 of 107 total issues
Function checkDescriptionBanner
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const checkDescriptionBanner = async (
client: TeamSpeakClient | undefined,
presenceString: string | undefined,
data: SteamUser.PersonaData,
steamId: 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 authenticate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const authenticate = async function (
req: Request,
res: Response,
next: NextFunction
): Promise<any> {
- 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
Consider simplifying this complex logical expression. Open
if (
data.diff?.game_played_app_id?.to === info.appId ||
(data.diff?.rich_presence?.from.find((e) => e.key === 'game:state')?.value === 'game' &&
data.diff?.rich_presence?.to.find((e) => e.key === 'game:state')?.value === 'lobby' &&
data.diff?.rich_presence?.from.find((e) => e.key === 'game:mode')?.value === 'competitive' &&
Avoid too many return
statements within this function. Open
return lang.steam.status.Playing;
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return `${lang.steam.status.Playing} ${lang.message.to} ${app.appinfo.common.name}`;
Avoid too many return
statements within this function. Open
return `${lang.steam.status.Playing} ${lang.message.to} ${steamData.game_name}`;
Avoid too many return
statements within this function. Open
return 'xs';
Method continuize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def continuize
i = 0
loop do
if i > self.length
- 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
Method components
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def components
return @components if defined?(@components)
@components =
if new_feature?
- 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
Method bump_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def bump_type(other_version)
# Return nil if the other version is not greater than the current version
if other_version <= self
return nil
end
- 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"