shawkinsl/mtga-tracker

View on GitHub

Showing 468 of 468 total issues

Similar blocks of code found in 3 locations. Consider refactoring.
Open

(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery'], factory);
    } else if (typeof exports === 'object') {
Severity: Major
Found in docs/lib/lightbox/src/js/lightbox.js and 2 other locations - About 1 mo to fix
docs/lib/lightbox/dist/js/lightbox-plus-jquery.js on lines 10270..10773
docs/lib/lightbox/dist/js/lightbox.js on lines 16..519

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 4931.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery'], factory);
    } else if (typeof exports === 'object') {
Severity: Major
Found in docs/lib/lightbox/dist/js/lightbox-plus-jquery.js and 2 other locations - About 1 mo to fix
docs/lib/lightbox/dist/js/lightbox.js on lines 16..519
docs/lib/lightbox/src/js/lightbox.js on lines 16..519

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 4931.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

(function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery'], factory);
    } else if (typeof exports === 'object') {
Severity: Major
Found in docs/lib/lightbox/dist/js/lightbox.js and 2 other locations - About 1 mo to fix
docs/lib/lightbox/dist/js/lightbox-plus-jquery.js on lines 10270..10773
docs/lib/lightbox/src/js/lightbox.js on lines 16..519

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 4931.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File lightbox-plus-jquery.js has 6992 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery JavaScript Library v3.2.1
 * https://jquery.com/
 *
 * Includes Sizzle.js
Severity: Major
Found in docs/lib/lightbox/dist/js/lightbox-plus-jquery.js - About 2 wks to fix

    Function Sizzle has 1452 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    (function( window ) {
    
    var i,
        support,
        Expr,
    Severity: Major
    Found in docs/lib/lightbox/dist/js/lightbox-plus-jquery.js - About 1 wk to fix

      Function parse_game_state_message has a Cognitive Complexity of 279 (exceeds 5 allowed). Consider refactoring.
      Open

      def parse_game_state_message(message, timestamp=None):
          # DOM: ok
          import app.mtga_app as mtga_app
          with mtga_app.mtga_watch_app.game_lock:  # the game state may become inconsistent in between these steps, so lock it
              if "turnInfo" in message.keys():
      Severity: Minor
      Found in app/parsers.py - About 5 days 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

      File mainRenderer.js has 1384 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      console.time('init')
      
      const request = require("request")
      const crypto = require("crypto")
      const ReconnectingWebSocket = require('./vendor/rws.js')
      Severity: Major
      Found in electron/mainRenderer.js - About 3 days to fix

        Function onMessage has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
        Open

        let onMessage = (data) => {
            data = JSON.parse(event.data)
            if (data.data_type == "game_state") {
                if (data.match_complete) {
        
        
        Severity: Minor
        Found in electron/mainRenderer.js - About 2 days 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

        File main.js has 913 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const console = require('console');
        const jwt = require('jsonwebtoken');
        const { inspectorRouter } = require("./inspectorApi")
        
        global.updateReady = false
        Severity: Major
        Found in electron/main.js - About 2 days to fix

          File settingsRenderer.js has 878 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          const { remote, ipcRenderer, shell } = require('electron')
          const {dialog, Menu, MenuItem,} = remote
          const fs = require('fs')
          
          const API_URL = remote.getGlobal("API_URL")
          Severity: Major
          Found in electron/settingsRenderer.js - About 2 days to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                          promiseSerial(docs.map(draft => () => fetch(insertDraftURL, {method: "POST", body: JSON.stringify(draft)})
                              .then(resp => resp.json())
                              .then(data => {
                                if (data.error) {
                                  throw new Error(data.error)
            Severity: Major
            Found in electron/settingsRenderer.js and 1 other location - About 1 day to fix
            electron/settingsRenderer.js on lines 644..670

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 306.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                      let insertFuncs = regularDocs.map(doc => () => fetch(fetchURL, {method: "POST", body: JSON.stringify(doc)})
                          .then(resp => resp.json())
                          .then(data => {
                            if (data.error) {
                              throw new Error(data.error)
            Severity: Major
            Found in electron/settingsRenderer.js and 1 other location - About 1 day to fix
            electron/settingsRenderer.js on lines 568..594

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 306.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function WOW has 298 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              var WOW = function () {
                function WOW() {
                  var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
            
                  _classCallCheck(this, WOW);
            Severity: Major
            Found in docs/lib/wow/wow.js - About 1 day to fix

              File parsers.py has 661 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import json
              import pprint
              import datetime
              import util
              from app.models.game import Game, Match, Player
              Severity: Major
              Found in app/parsers.py - About 1 day to fix

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                  $("#send-feedback").click((e) => {
                    console.log("sending feedback")
                    let data = {
                      feedbackType: $("#feedback-type-select").val(),
                      feedbackText: $("#feedback-text").val(),
                Severity: Major
                Found in electron/settingsRenderer.js and 1 other location - About 1 day to fix
                electron/settingsRenderer.js on lines 809..832

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 265.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                  $("#send-feedback").click((e) => {
                    console.log("sending feedback")
                    let data = {
                      feedbackType: $("#feedback-type-select").val(),
                      feedbackText: $("#feedback-text").val(),
                Severity: Major
                Found in electron/settingsRenderer.js and 1 other location - About 1 day to fix
                electron/settingsRenderer.js on lines 834..857

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 265.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                function passThrough(endpoint, passData, errors) {
                  if (!errors) {
                    errors = []
                  }
                  return new Promise((resolve, reject) => {
                Severity: Major
                Found in electron/settingsRenderer.js and 1 other location - About 1 day to fix
                electron/settingsRenderer.js on lines 892..918

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 256.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                function passThrough(endpoint, passData, errors) {
                  if (!errors) {
                    errors = []
                  }
                  return new Promise((resolve, reject) => {
                Severity: Major
                Found in electron/settingsRenderer.js and 1 other location - About 1 day to fix
                electron/settingsRenderer.js on lines 960..986

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 256.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                var unHideDeck = function(deckID, button) {
                  if (button) {
                    $(button).prop('disabled', true);
                  }
                  console.log("unhideDeck called")
                Severity: Major
                Found in electron/inspector/js/api.js and 1 other location - About 1 day to fix
                electron/inspector/js/api.js on lines 270..297

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 251.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                var hideDeck = function(deckID, button) {
                  if (button) {
                    $(button).prop('disabled', true);
                  }
                  console.log("hideDeck called")
                Severity: Major
                Found in electron/inspector/js/api.js and 1 other location - About 1 day to fix
                electron/inspector/js/api.js on lines 299..326

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 251.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language