shawkinsl/mtga-tracker

View on GitHub

Showing 468 of 468 total issues

Function block_watch_task has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
Open

def block_watch_task(in_queue, out_queue):
    BLOCK_SEQ = 0
    while all_die_queue.empty():
        block_recieved = in_queue.get()
        if block_recieved is None:
Severity: Minor
Found in app/tasks.py - 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

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

let donutOptions = {
  maintainAspectRatio: false,
  legend: {
      labels: {
          fontColor: "#474747"
Severity: Major
Found in electron/inspector/js/admin.js and 1 other location - About 1 day to fix
electron/inspector/js/profile.js on lines 25..59

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 239.

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 donutOptions = {
  maintainAspectRatio: false,
  legend: {
      labels: {
          fontColor: "#474747"
Severity: Major
Found in electron/inspector/js/profile.js and 1 other location - About 1 day to fix
electron/inspector/js/admin.js on lines 5..39

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 239.

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 ajax has 251 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ajax: function( url, options ) {

        // If url is an object, simulate pre-1.5 signature
        if ( typeof url === "object" ) {
            options = url;
Severity: Major
Found in docs/lib/lightbox/dist/js/lightbox-plus-jquery.js - About 1 day to fix

    Function setDocument has 245 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    setDocument = Sizzle.setDocument = function( node ) {
        var hasCompare, subWindow,
            doc = node ? node.ownerDocument || node : preferredDoc;
    
        // Return early if doc is invalid or already selected
    Severity: Major
    Found in docs/lib/lightbox/dist/js/lightbox-plus-jquery.js - About 1 day to fix

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

              Object.keys(game.players[0].deck.cards).forEach(cardID => {
                let card = cardUtils.allCards.findCard(cardID)
                if (card) {
                  let cardObj = {
                    cardID: cardID,
      Severity: Major
      Found in electron/inspector/js/game.js and 2 other locations - About 1 day to fix
      electron/inspector/js/game.js on lines 104..119
      electron/inspector/js/game.js on lines 125..140

      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 222.

      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

              Object.keys(game.players[1].deck.cards).forEach(cardID => {
                let card = cardUtils.allCards.findCard(cardID)
                if (card) {
                  let cardObj = {
                    cardID: cardID,
      Severity: Major
      Found in electron/inspector/js/game.js and 2 other locations - About 1 day to fix
      electron/inspector/js/game.js on lines 86..101
      electron/inspector/js/game.js on lines 104..119

      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 222.

      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

                  Object.keys(game.players[0].deck.sideboard).forEach(cardID => {
                    let card = cardUtils.allCards.findCard(cardID)
                    if (card) {
                      let cardObj = {
                        cardID: cardID,
      Severity: Major
      Found in electron/inspector/js/game.js and 2 other locations - About 1 day to fix
      electron/inspector/js/game.js on lines 86..101
      electron/inspector/js/game.js on lines 125..140

      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 222.

      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

          if (appData.winLossColorChart) {
              appData.winLossColorChart.options.scales.yAxes[0].gridLines.color = "#d5d5d5"
              appData.winLossColorChart.options.scales.xAxes[0].gridLines.color = "#d5d5d5"
              appData.winLossColorChart.options.scales.xAxes[0].ticks.fontColor = "#696969"
              appData.winLossColorChart.options.scales.yAxes[0].ticks.fontColor = "#696969"
      Severity: Major
      Found in electron/inspector/js/main.js and 1 other location - About 1 day to fix
      electron/inspector/js/main.js on lines 94..102

      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 221.

      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

          if (appData.winLossColorChart) {
              appData.winLossColorChart.options.scales.yAxes[0].gridLines.color = "#5d5d5d"
              appData.winLossColorChart.options.scales.xAxes[0].gridLines.color = "#5d5d5d"
              appData.winLossColorChart.options.scales.yAxes[0].ticks.fontColor = "#dedede"
              appData.winLossColorChart.options.scales.xAxes[0].ticks.fontColor = "#dedede"
      Severity: Major
      Found in electron/inspector/js/main.js and 1 other location - About 1 day to fix
      electron/inspector/js/main.js on lines 161..169

      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 221.

      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

        if(settingsWindow == null) {
          let settingsWidth = debug ? 1400 : 1025;
      
          const settingsWindowStateMgr = windowStateKeeper('settings')
          settingsWindow = new BrowserWindow({width: settingsWidth,
      Severity: Major
      Found in electron/main.js and 1 other location - About 1 day to fix
      electron/main.js on lines 494..521

      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 220.

      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

        if(collectionWindow == null) {
          let collectionWidth = debug ? 1400 : 1025;
      
          const collectionWindowStateMgr = windowStateKeeper('collection')
          collectionWindow = new BrowserWindow({width: collectionWidth,
      Severity: Major
      Found in electron/main.js and 1 other location - About 1 day to fix
      electron/main.js on lines 459..486

      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 220.

      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

                  try:
                      parsers.parse_game_state_message(game_state_message, blob["timestamp"] if "timestamp" in blob.keys() else None)
                  except:
                      import traceback
                      exc = traceback.format_exc()
      Severity: Major
      Found in app/dispatchers.py and 1 other location - About 1 day to fix
      app/dispatchers.py on lines 98..109

      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 129.

      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

              elif message_type == "GREMessageType_MulliganReq":
                  try:
                      parsers.parse_mulligan_req_message(message, blob["timestamp"] if "timestamp" in blob.keys() else None)
                  except:
                      import traceback
      Severity: Major
      Found in app/dispatchers.py and 1 other location - About 1 day to fix
      app/dispatchers.py on lines 88..97

      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 129.

      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 methods has 207 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var methods = (function () {
              // private properties and methods go here
              var c = {
                      bcClass: 'sf-breadcrumb',
                      menuClass: 'sf-js-enabled',
      Severity: Major
      Found in docs/lib/superfish/superfish.js - About 1 day to fix

        File lity.js has 505 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /*! Lity - v2.2.2 - 2017-07-17
        * http://sorgalla.com/lity/
        * Copyright (c) 2015-2017 Jan Sorgalla; Licensed MIT */
        (function(window, factory) {
            if (typeof define === 'function' && define.amd) {
        Severity: Major
        Found in docs/lib/lity/lity.js - About 1 day to fix

          File inspectorApi.js has 482 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var { cardsColors } = require("mtga")
          var { Router } = require('electron-routes');
          var path = require("path")
          const keytar = require('keytar')
          const { MongoClient, ObjectID } = require('mongodb')
          Severity: Minor
          Found in electron/inspectorApi.js - About 7 hrs to fix

            File wow.js has 472 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
            * WOW wow.js - v1.3.0 - 2016-10-04
            * https://wowjs.uk
            * Copyright (c) 2016 Thomas Grainger; Licensed MIT
            */
            Severity: Minor
            Found in docs/lib/wow/wow.js - About 7 hrs to fix

              Function onMessage has 182 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              let onMessage = (data) => {
                  data = JSON.parse(event.data)
                  if (data.data_type == "game_state") {
                      if (data.match_complete) {
              
              
              Severity: Major
              Found in electron/mainRenderer.js - About 7 hrs to fix

                Function Deferred has 176 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    Deferred: function( func ) {
                        var tuples = [
                
                                // action, add listener, callbacks,
                                // ... .then handlers, argument index, [final state]
                Severity: Major
                Found in docs/lib/lightbox/dist/js/lightbox-plus-jquery.js - About 7 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language