cerniglj1/osrs-quest-tool

View on GitHub

Showing 82 of 336 total issues

Function meetsRequirement has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function meetsRequirement(quest, account) {
  if (quest === 'Recipe for Disaster') {
    // TODO
    // Pirate Pete Subquest of Recipe for Disaster
    return true;
Severity: Major
Found in lib/osrstools.js - About 2 hrs to fix

    Function parse_req_str has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

    def parse_req_str(requirementString):
        requirementObject = {}
        quests = []
        x_arr = requirementString.split(' ')
        # TODO
    Severity: Minor
    Found in tools/getQuestData.py - 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 test has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function test() {
        var reqs = {
    
            "quests": [
                "Big Chompy Bird Hunting",
    Severity: Major
    Found in lib/model/quest/Requirement.js - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

              if (this.osrsAccount) {
                  const attklvl = this.osrsAccount.main.skills.attack?.level ?? 1;
                  const strlvl = this.osrsAccount.main.skills.strength?.level ?? 1;
                  const deflvl = this.osrsAccount.main.skills.defence?.level ?? 1;
                  const rangedlvl = this.osrsAccount.main.skills.ranged?.level ?? 1;
      Severity: Critical
      Found in src/model/account/OsrsAccount.ts - About 1 hr to fix

        Function init has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        var jumpToCode = (function init() {
            // Classes of code we would like to highlight in the file view
            var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
        
            // Elements to highlight in the file listing view
        Severity: Minor
        Found in coverage/lcov-report/block-navigation.js - 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 setCombatLevel has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          setCombatLevel() {
            var attklvl = this.osrsAccount.main.skills.attack.level
              ? this.osrsAccount.main.skills.attack.level
              : 1;
            var strlvl = this.osrsAccount.main.skills.strength.level
        Severity: Minor
        Found in lib/model/account/OsrsAccount.js - About 1 hr to fix

          Function highestBoost has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function highestBoost(skillName) {
            /**
             * List of highest boostable levels with skills including spicy stew etc
             */
            switch (skillName) {
          Severity: Minor
          Found in lib/osrstools.js - About 1 hr to fix

            Function highestBoost has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              highestBoost(skillName) {
                /**
                 *
                 */
                switch (skillName) {
            Severity: Minor
            Found in lib/model/quest/QuestTool.js - About 1 hr to fix

              Function test has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function test(): void {
                  const reqs = {
                      "quests": [
                          "Big Chompy Bird Hunting",
                          "Jungle Potion"
              Severity: Minor
              Found in src/model/quest/Requirement.ts - About 1 hr to fix

                Function enableUI has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function enableUI() {
                        var i,
                            el,
                            ithSorter = function ithSorter(i) {
                                var col = cols[i];
                Severity: Minor
                Found in coverage/lcov-report/sorter.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                            if (
                              account.main.skills[cur.skill] + highestBoost(cur.skill) <
                              cur.level
                            ) {
                              return false;
                  Severity: Major
                  Found in lib/osrstools.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        for any_requirement in some_list:
                                            reqs.append(
                                                {'type': 'quest', 'name': any_requirement.text})
                                # levels_and_quests = levels_and_quests[0]
                                # levels_list = levels_and_quests.find_all("li", {"class": "scp"})
                    Severity: Major
                    Found in tools/getQuestData.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                  if (this.osrsAccount.main.skills[cur.skill] < cur.level) {
                                    return false;
                                  }
                      Severity: Major
                      Found in lib/model/quest/QuestTool.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  if (account.main.skills[cur.skill] < cur.level) {
                                    return false;
                                  }
                        Severity: Major
                        Found in lib/osrstools.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                  if (cur.boostable) {
                                    // check if max stew can reach
                                    if (
                                      account.main.skills[cur.skill] + highestBoost(cur.skill) <
                                      cur.level
                          Severity: Major
                          Found in lib/osrstools.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                    if (account.main.combatLevel < cur.level) {
                                      return false;
                                    }
                            Severity: Major
                            Found in lib/osrstools.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                        if (this.osrsAccount.main.combatLevel < cur.level) {
                                          return false;
                                        }
                              Severity: Major
                              Found in lib/model/quest/QuestTool.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                          if (account.main.skills[cur.skill] < cur.level) {
                                            return false;
                                          }
                                Severity: Major
                                Found in lib/osrstools.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                          if (account.main.combatLevel < cur.level) {
                                            return false;
                                          }
                                  Severity: Major
                                  Found in lib/osrstools.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                        for any_requirement in req_items:
                                                            skills_needed.append("any: "+any_requirement)
                                    
                                    
                                    Severity: Major
                                    Found in tools/getQuestData.py - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language