Idrinth/IDotD

View on GitHub
src/mods/raids.js

Summary

Maintainability
F
4 days
Test Coverage

Function process has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
Open

    process: function() {
      /**
             * 
             * @returns {Boolean}
             */
Severity: Minor
Found in src/mods/raids.js - About 1 day 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 process has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    process: function() {
      /**
             * 
             * @returns {Boolean}
             */
Severity: Major
Found in src/mods/raids.js - About 4 hrs to fix

File raids.js has 326 lines of code (exceeds 250 allowed). Consider refactoring.
Open

idrinth.raids = {
  /**
     * @type Object
     */
  list: {},
Severity: Minor
Found in src/mods/raids.js - About 3 hrs to fix

Function join has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      let join = function() {
        /**
                 * 
                 * @returns {function[]}
                 */
Severity: Major
Found in src/mods/raids.js - About 3 hrs to fix

Function getServerLink has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    getServerLink: function(key) {
      /**
             * 
             * @param {Object} list
             * @param {String} key
Severity: Major
Found in src/mods/raids.js - About 2 hrs to fix

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

    getServerLink: function(key) {
      /**
             * 
             * @param {Object} list
             * @param {String} key
Severity: Minor
Found in src/mods/raids.js - 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 getServerMethods has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        let getServerMethods = function() {
          /**
                     * 
                     * @param {String} key
                     * @returns {Function}
Severity: Minor
Found in src/mods/raids.js - About 1 hr to fix

Function import has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  import: function(id) {
    if (!idrinth.platform) {
      return;
    }
    /**
Severity: Minor
Found in src/mods/raids.js - About 1 hr to fix

Function handlePrivates has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      let handlePrivates = function() {
        /**
                 * 
                 * @param {String} reply
                 * @returns {undefined}
Severity: Minor
Found in src/mods/raids.js - About 1 hr to fix

Function getLink has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      let getLink = function(list, key, prefix, tag) {
        let build = function(data, tag, prefix) {
          try {
            return (
              prefix +
Severity: Minor
Found in src/mods/raids.js - About 1 hr to fix

Consider simplifying this complex logical expression.
Open

            if (
              ((!idrinth.settings.get("bannedRaids#" + raid.raid) &&
                !idrinth.settings.get("raidWhitelist")) ||
                (idrinth.settings.get("bannedRaids#" + raid.raid) &&
                  idrinth.settings.get("raidWhitelist"))) &&
Severity: Major
Found in src/mods/raids.js - About 40 mins to fix

There are no issues that match your filters.

Category
Status