Idrinth/IDotD

View on GitHub

Showing 162 of 178 total issues

File workers.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

idrinth.workers = {
  list: '###WORKERS###',
  result: {
       /**
         * @param {string} list
Severity: Minor
Found in src/mods/workers.js - About 2 hrs to fix

Function refreshMembers has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let refreshMembers = function() {
      /**
             * 
             * @param {String} data
             * @returns {undefined}
Severity: Major
Found in src/mods/chat.js - About 2 hrs to fix

Function makeInputLabel has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let makeInputLabel = function(config) {
      /**
             *
             * @param {String|Number} value
             * @param {Array} list
Severity: Major
Found in src/mods/ui.js - About 2 hrs to fix

Function replaceInText has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  replaceInText: function(message, regex, callbacks, lastField) {
    /**
         * 
         * @param {String} message
         * @param {RegExp} regex
Severity: Major
Found in src/mods/chat.js - About 2 hrs to fix

Function applyMembers has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      let applyMembers = function(data) {
        /**
                 * 
                 * @returns {undefined}
                 */
Severity: Major
Found in src/mods/chat.js - About 2 hrs to fix

Function showOptions has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  showOptions: function(event, element) {
    event.preventDefault();
    idrinth.ui.base.appendChild(
      idrinth.ui.buildElement({
        type: "ul",
Severity: Major
Found in src/mods/chat.js - About 2 hrs to fix

Function baseCalculator has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let baseCalculator = function(checkElementFunc) {
      let factor = idrinth.settings.get("factor") ? 10 : 1;
      /**
             *
             * @param {string} building
Severity: Major
Found in src/mods/land.js - About 2 hrs to fix

Function make has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let make = function(x, name) {
      let makeElement = function(label, number, description) {
        return {
          content: label + " " + idrinth.ui.formatNumber(number),
          attributes: [
Severity: Major
Found in src/mods/tier.js - About 2 hrs to fix

Function start has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  start: function() {
    /**
         * @returns {undefined}
         */
    let reload = function(data) {
Severity: Major
Found in src/mods/inframe.js - About 2 hrs to fix

Function buildRaidJoinList has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        let buildRaidJoinList = function() {
          /**
                     *
                     * @param {Array} list
                     * @param {String} header
Severity: Major
Found in src/mods/ui.js - About 2 hrs to fix

Function run has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    run: function(url, success, failure, timeout, additionalHeader) {
      if(!idrinth.start && idrinth.settings.get("server")) {
          return;
      }
      let requestHandler = new XMLHttpRequest();
Severity: Major
Found in src/mods/core.js - About 2 hrs to fix

Function newBoss has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          function newBoss(data, boss) {
            idrinth.war.element.childNodes[1].appendChild(
              idrinth.ui.buildElement({
                type: "tr",
                id: "idrinth-war-" + boss,
Severity: Major
Found in src/mods/war.js - About 2 hrs to fix

chat has 22 functions (exceeds 20 allowed). Consider refactoring.
Open

idrinth.chat = {
  /**
     * own user id
     * @type Number
     */
Severity: Minor
Found in src/mods/chat.js - About 2 hrs to fix

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

    let sendAlive = function() {
      /**
             *
             * @returns {String|idrinth.user.identifier}
             */
Severity: Major
Found in src/mods/user.js - About 2 hrs to fix

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

  buildModal: function(title, content, altFunc) {
    let mod = {
      children: [],
      css: "idrinth-hovering-box idrinth-popup idrinth-" +
        (typeof altFunc === "string" ? "confim" : "alert")
Severity: Major
Found in src/mods/ui.js - About 2 hrs to fix

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

            let notify = function(message, own, chatId) {
              /**
                             * 
                             * @param {Number} chatId
                             * @returns {Boolean}
Severity: Major
Found in src/mods/chat.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 triggered has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    triggered: function(event) {
      /**
             *
             * @param {HTMLElement} el
             * @param {string} event
Severity: Minor
Found in src/mods/core.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 start has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  start: function() {
    /**
         * @returns {undefined}
         */
    let reload = function(data) {
Severity: Minor
Found in src/mods/inframe.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 showTooltip has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let showTooltip = function(element) {
      /**
             *
             * @param {object} set
             * @param {HTMLElement} element
Severity: Major
Found in src/mods/names.js - About 2 hrs to fix
Severity
Category
Status
Source
Language