NatoBoram/eldarya-enhancements

View on GitHub

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() {}

Severity: Minor
Found in src/local_storage/local_storage.ts - About 3 hrs to fix

    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
            }
    Severity: Minor
    Found in src/takeover/classes/buy_action.ts - About 2 hrs to fix

    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")
    Severity: Minor
    Found in src/appearance/dressing_experience.ts - About 2 hrs to fix

    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
    
    
    Severity: Major
    Found in src/appearance/dressing_experience.ts - About 2 hrs to fix

      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
              }
      Severity: Major
      Found in src/takeover/classes/buy_action.ts - About 2 hrs to fix

        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")
        Severity: Major
        Found in src/appearance/dressing_experience.ts - About 2 hrs to fix

          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"
          Severity: Minor
          Found in src/takeover/classes/exploration_action.ts - About 2 hrs to fix

            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> = {
            Severity: Major
            Found in src/ui/settings.ts - About 2 hrs to fix

              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
              
              
              Severity: Major
              Found in src/ui/wishlist.ts - About 2 hrs to fix

                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({
                Severity: Minor
                Found in src/appearance/fake_favourites.ts - About 2 hrs to fix

                  Function waitExploration has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private async waitExploration(
                          selected?: AutoExploreLocation,
                      ): Promise<boolean> {
                          document
                              .querySelector<HTMLDivElement>(
                  Severity: Minor
                  Found in src/takeover/classes/exploration_action.ts - About 2 hrs to fix

                    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 }),
                    Severity: Minor
                    Found in src/appearance/fake_favourites.ts - About 1 hr to fix

                      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
                              }
                      Severity: Minor
                      Found in src/takeover/classes/summer_game_action.ts - About 1 hr to fix

                        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({
                        Severity: Minor
                        Found in src/appearance/fake_favourites.ts - About 1 hr to fix

                          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
                          
                          
                          Severity: Minor
                          Found in src/ui/wishlist.ts - About 1 hr to fix

                          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()
                          
                          
                          Severity: Minor
                          Found in src/ui/auctions.ts - About 1 hr to fix

                            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) {
                            Severity: Minor
                            Found in src/ui/mall.ts - About 1 hr to fix

                              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
                                  }
                              Severity: Minor
                              Found in src/ui/carousel.ts - About 1 hr to fix

                                Function waitExploration has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    private async waitExploration(
                                        selected?: AutoExploreLocation,
                                    ): Promise<boolean> {
                                        document
                                            .querySelector<HTMLDivElement>(
                                Severity: Minor
                                Found in src/takeover/classes/exploration_action.ts - About 1 hr to fix

                                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) {
                                Severity: Minor
                                Found in src/ui/market.ts - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language