Showing 55 of 2,340 total issues
LocalStorage
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
export class LocalStorage {
private static readonly localStorage = localStorage
private constructor() {}
Function perform
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
async perform(): Promise<boolean> {
if (location.pathname !== "/marketplace") {
pageLoad("/marketplace")
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
Function handleGroups
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
async function handleGroups(categoryContainer: HTMLDivElement): Promise<void> {
const appearanceCategory = categoryContainerDataSet(categoryContainer)
if (!appearanceCategory) return
wardrobe.setCategory(appearanceCategory)
categoryContainer.classList.remove("active")
- 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 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function loadBackground(): Promise<void> {
if (loading) return
loading = true
let success = true
Function perform
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
async perform(): Promise<boolean> {
if (location.pathname !== "/marketplace") {
pageLoad("/marketplace")
return true
}
Function handleGroups
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function handleGroups(categoryContainer: HTMLDivElement): Promise<void> {
const appearanceCategory = categoryContainerDataSet(categoryContainer)
if (!appearanceCategory) return
wardrobe.setCategory(appearanceCategory)
categoryContainer.classList.remove("active")
File exploration_action.ts
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
import type { Template } from "hogan.js"
import { captureEnd } from "../../ajax/capture_end"
import { changeRegion } from "../../ajax/change_region"
import { explorationResults } from "../../ajax/exploration_results"
import { Result } from "../../api/result.enum"
Function loadSettings
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function loadSettings(): void {
const accountRight = document.querySelector("#account-right div")
if (!accountRight || accountRight.querySelector(".account-ee-bloc")) return
const settings: Partial<Settings> = {
Function insertWishlist
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function insertWishlist(): void {
// Assistance
const assistance = document.querySelector(".marketplace-assistance")
if (assistance) assistance.innerHTML = translate.market.wishlist.assistance
Function showRenameFavourite
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function showRenameFavourite(
favourite: FavouriteOutfit,
): Promise<FavouriteOutfit | null> {
const template: Template = require("../templates/html/rename_favourite_outfit_flavr.html")
const rendered = template.render({
Function waitExploration
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async waitExploration(
selected?: AutoExploreLocation,
): Promise<boolean> {
document
.querySelector<HTMLDivElement>(
Function showFavourite
has 48 lines of code (exceeds 25 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 }),
Function perform
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
async perform(): Promise<boolean> {
if (location.pathname !== "/event/summer/game") {
pageLoad("/event/summer/game")
return true
}
Function showOutfit
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function showOutfit(): Promise<FavouriteOutfit | null> {
const template: Template = require("../templates/html/created_outfit_flavr.html")
return new Promise(resolve => {
$.flavr({
Function insertWishlist
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function insertWishlist(): void {
// Assistance
const assistance = document.querySelector(".marketplace-assistance")
if (assistance) assistance.innerHTML = translate.market.wishlist.assistance
- 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 loadHistory
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function loadHistory(marketplaceActiveAuctions: HTMLDivElement): void {
marketplaceActiveAuctions.querySelector("style")?.remove()
marketplaceActiveAuctions.querySelector("#purchase-history")?.remove()
marketplaceActiveAuctions.querySelector("#sale-history")?.remove()
Function save
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function save(mallEntry: MallEntry): boolean {
const price = Number(
document.querySelector<HTMLInputElement>(".flavr-prompt")?.value.trim(),
)
if (!price || price <= 0) {
Function loadCarousel
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function loadCarousel(): void {
const carouselInner = document.querySelector("#carousel-inner")
if (!carouselInner || document.querySelector(".carousel-ee")) {
return
}
Function waitExploration
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private async waitExploration(
selected?: AutoExploreLocation,
): Promise<boolean> {
document
.querySelector<HTMLDivElement>(
- 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 save
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function save(marketEntry: MarketEntry): boolean {
const price = Number(
document.querySelector<HTMLInputElement>(".flavr-prompt")?.value.trim(),
)
if (!price || price <= 0) {