Idrinth/IDotD

View on GitHub

Showing 162 of 178 total issues

Function getServerPart has 91 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      function getServerPart(name) {
        return [
          {
            css: "idrinth-line idrinth-tooltip-header",
            type: "a",
Severity: Major
Found in src/mods/names.js - About 3 hrs to fix

Function addTagged has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  addTagged: function(name) {
    /**
         *
         * @param {string} key
         * @returns {Boolean}
Severity: Major
Found in src/mods/tier.js - About 3 hrs to fix

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

  start: function() {
    /**
         *
         * @param {Sstring} name
         * @returns {String}
Severity: Major
Found in src/mods/user.js - About 3 hrs to fix

File war.js has 310 lines of code (exceeds 250 allowed). Consider refactoring.
Open

idrinth.war = {
  /**
     *
     * @type {string}
     */
Severity: Minor
Found in src/mods/war.js - About 3 hrs to fix

Function getPopupContent has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let getPopupContent = function(chat, user, rankId) {
      /**
             * 
             * @param {Number} chat
             * @returns {Array}
Severity: Major
Found in src/mods/chat.js - About 3 hrs to fix

Function div has 82 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  P.div = function(y) {
    var x = this,
      Big = x.constructor,
      // dividend
      dvd = x.c,
Severity: Major
Found in src/libs/big.js - About 3 hrs to fix

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

  start: function() {
    /**
         * fills the data from json in idotd
         * @returns {undefined}
         */
Severity: Major
Found in src/mods/settings.js - About 3 hrs to fix

File core.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

idrinth.core = {
  /**
     *
     * @param {string} str
     * @returns {string}
Severity: Minor
Found in src/mods/core.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 buildActions has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        let buildActions = function() {
          /**
                     *
                     * @param {string} label
                     * @param {string} onclick
Severity: Major
Found in src/mods/ui.js - About 3 hrs to fix

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

  start: function() {
    /**
         * build the gui part
         * @returns {undefined}
         */
Severity: Major
Found in src/mods/war.js - About 3 hrs to fix

Function buildChat has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  buildChat: function(id, name, rank, pass) {
    if (!idrinth.chat.elements.chats) {
      idrinth.core.timeouts.add(
        "chat-" + id,
        function() {
Severity: Major
Found in src/mods/ui.js - About 2 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 process has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    process: function() {
      let date = new Date().getTime() + new Date().getMilliseconds() / 1000;
      let min = 10;
      /**
             *
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 21 (exceeds 5 allowed). Consider refactoring.
Open

  start: function() {
    /**
         *
         * @returns {undefined}
         */
Severity: Minor
Found in src/stable.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 makeField has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      let makeField = function(listKey, difficulty, ic) {
        let ln = {
          type: "td",
          attributes: []
        };
Severity: Major
Found in src/mods/workers.js - About 2 hrs to fix

Function handle has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  handle: function(mutations, isPrivate) {
    /**
         *
         * @param {HTMLElement} element
         * @returns {undefined}
Severity: Major
Found in src/mods/observer.js - About 2 hrs to fix

Function build has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let build = function() {
      idrinth.war.element = idrinth.ui.buildElement({
        id: "idrinth-war",
        css: "idrinth-central-box idrinth-hovering-box idrinth-hide",
        children: [
Severity: Major
Found in src/mods/war.js - About 2 hrs to fix

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

  start: function() {
    /**
         *
         * @returns {undefined}
         */
Severity: Major
Found in src/stable.js - About 2 hrs to fix

Function minus has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  P.sub = P.minus = function(y) {
    var i,
      j,
      t,
      xLTy,
Severity: Major
Found in src/libs/big.js - About 2 hrs to fix
Severity
Category
Status
Source
Language