Showing 55 of 2,340 total issues
Function translation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function translation(): Translation {
if (location.hostname.endsWith(".com.br")) return en
if (location.hostname.endsWith(".de")) return en
if (location.hostname.endsWith(".es")) return en
if (location.hostname.endsWith(".hu")) return en
- 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 loadBackground
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export async function loadBackground(): Promise<void> {
if (loading) return
loading = true
let success = true
- 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 perform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
async perform(): Promise<boolean> {
if (location.pathname !== "/pet") {
pageLoad("/pet")
return true
}
- 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
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
if (location.hostname.endsWith(".ru")) return en
Avoid too many return
statements within this function. Open
if (location.hostname.endsWith(".fr")) return fr
Avoid too many return
statements within this function. Open
if (location.hostname.endsWith(".it")) return en
Avoid too many return
statements within this function. Open
if (location.hostname.endsWith(".com")) return en
Avoid too many return
statements within this function. Open
if (location.hostname.endsWith(".pl")) return en
Avoid too many return
statements within this function. Open
return true
Avoid too many return
statements within this function. Open
else return en
Function takeover
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async function takeover(): Promise<void> {
if (!SessionStorage.takeover) return
if (dailyAction.condition()) await dailyAction.perform()
const action = actions.find(action => action.key === SessionStorage.action)
- 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 removeClothes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function removeClothes(): void {
const avatar = Sacha.Avatar.avatars["#appearance-preview"]
if (!avatar) return
for (let i = avatar.children.length - 1; i >= 0; i--) {
- 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 loadDressingExperience
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function loadDressingExperience(): Promise<void> {
if (!location.pathname.startsWith("/player/appearance")) return
handledCategories.clear()
loading = false
- 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 showFavourite
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function showFavourite(favourite: FavouriteOutfit): void {
const template: Template = require("../templates/html/favourite_outfit_flavr.html")
$.flavr({
content: template.render({ ...favourite, translate }),
- 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"