Idrinth/IDotD

View on GitHub

Showing 162 of 178 total issues

Function makeTabs has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        let makeTabs = function(config) {
          let head = [];
          let first = true;
          let body = [];
          /**
Severity: Major
Found in src/mods/ui.js - About 2 hrs to fix

Function startInternal has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let startInternal = function() {
      /**
             * initializes all modules
             * @returns {undefined}
             */
Severity: Major
Found in src/stable.js - About 2 hrs to fix

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

  start: function() {
    let pos = 1;
    /**
         * parsed a json-response and fills tier list and exclusion list
         * @param {string} data
Severity: Major
Found in src/mods/tier.js - About 2 hrs to fix

Function start has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

  start: function() {
    /**
         * creates the tooltip-element
         * @returns {undefined}
         */
Severity: Minor
Found in src/mods/names.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 getIdentifier has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      let getIdentifier = function() {
        /**
                 * from http://stackoverflow.com/a/105074
                 * @returns {String}
                 */
Severity: Major
Found in src/mods/user.js - About 2 hrs to fix

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

        let applyMemberData = function() {
          /**
                     * 
                     * @param {HTMLElement} chat
                     * @param {Number} chatId
Severity: Minor
Found in src/mods/chat.js - About 2 hrs to fix

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

      let init = function() {
        if (!idrinth.text.initialized) {
          return;
        }
        if (idrinth.platform === "newgrounds") {
Severity: Minor
Found in src/stable.js - About 2 hrs to fix

Function run has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  run: function() {
    /**
         *
         * @param {string} added the path-segment defining the data returned
         * @returns {undefined}
Severity: Minor
Found in src/mods/names.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 start has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

  start: function() {
    let pos = 1;
    /**
         * parsed a json-response and fills tier list and exclusion list
         * @param {string} data
Severity: Minor
Found in src/mods/tier.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 getPromotionOptions has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      let getPromotionOptions = function(chat) {
        let promotionModes = [
          {
            chat: chat,
            label: "chat.actions.banUser",
Severity: Minor
Found in src/mods/chat.js - About 1 hr to fix

Function buildEmoticons has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  buildEmoticons: function(message) {
    if (!idrinth.chat.emotes.lookup) {
      return message;
    }
    let part = idrinth.core.escapeRegExp(
Severity: Minor
Found in src/mods/chat.js - About 1 hr to fix

Function process has 45 lines of code (exceeds 25 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 1 hr to fix

Function buildItem has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          let buildItem = function(label) {
            let isCheck =
              label === "mirele" || label === "kraken" || label === "utym";
            return {
              type: "tr",
Severity: Minor
Found in src/mods/ui.js - About 1 hr to fix

Function start has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  start: function() {
    /**
         * 
         * @returns {HTMLElement}
         */
Severity: Minor
Found in src/mods/chat.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 start has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  start: function() {
    /**
         *
         * @param {Sstring} name
         * @returns {String}
Severity: Minor
Found in src/mods/user.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 start has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  start: function() {
    let language =
      idrinth.settings.get("lang") ||
      window.navigator.userLanguage ||
      window.navigator.language ||
Severity: Minor
Found in src/mods/text.js - About 1 hr to fix

Function times has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  P.mul = P.times = function(y) {
    var c,
      x = this,
      Big = x.constructor,
      xc = x.c,
Severity: Minor
Found in src/libs/big.js - About 1 hr to fix

Function plus has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  P.add = P.plus = function(y) {
    var t, x = this, Big = x.constructor, a = x.s, b = (y = new Big(y)).s;

    // Signs differ?
    if (a != b) {
Severity: Minor
Found in src/libs/big.js - About 1 hr to fix

Function complexHandler has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    let complexHandler = function(message, regex, callbacks, lastField) {
      /**
             * 
             * @param {Number} count
             * @param {Array} callbacks
Severity: Minor
Found in src/mods/chat.js - About 1 hr to fix

Function loginActions has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  loginActions: function(key) {
    let chatLogin,
      success,
      urls = {
        register: "chat-service/register/",
Severity: Minor
Found in src/mods/chat.js - About 1 hr to fix
Severity
Category
Status
Source
Language