dodekeract/manta-config-engine-app

View on GitHub

Showing 34 of 108 total issues

File bind-changer.jsx has 543 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var store = require('../../store');
var actions = require('../../actions');

var Markdown = require('react-markdown');
var manta = require('dota2-manta-config-engine');
Severity: Major
Found in source/web/components/dialogs/bind-changer.jsx - About 1 day to fix

    Function render has 215 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render: function () {
            return (
                <div className="home">
                    <div className="jumbotron header">
                        <div className="container">
    Severity: Major
    Found in source/web/components/home.jsx - About 1 day to fix

      Function commandInfo has 178 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      window.commandInfo = function (c) {
          switch (c[0]) {
              case "ability":
                  var shortMatch = [1, 2, 3, 4, 5, 'ult'];
                  var longMatch = ['Ability 1', 'Ability 2', 'Ability 3', 'Ability 4', 'Ability 5', 'Ultimate'];
      Severity: Major
      Found in source/web/main.jsx - About 7 hrs to fix

        Function commandInfo has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
        Open

        window.commandInfo = function (c) {
            switch (c[0]) {
                case "ability":
                    var shortMatch = [1, 2, 3, 4, 5, 'ult'];
                    var longMatch = ['Ability 1', 'Ability 2', 'Ability 3', 'Ability 4', 'Ability 5', 'Ultimate'];
        Severity: Minor
        Found in source/web/main.jsx - About 3 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

        File store.js has 315 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var assign       = require('object-assign');
        var EventEmitter = require('events').EventEmitter;
        var JSZip        = require('jszip');
        var manta        = require('dota2-manta-config-engine');
        var platform     = require('platform');
        Severity: Minor
        Found in source/web/store.js - About 3 hrs to fix

          Function render has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              render: function () {
                  var properties = window.matchSetting[this.props.domain][this.props.id];
                  var tip = properties.info ? (
                          <i className="glyphicon glyphicon-question-sign" data-tip data-multiline={true} data-for={this.props.uniqueID}/>
                      ) : '';
          Severity: Major
          Found in source/web/components/settings-panel.jsx - About 3 hrs to fix

            Function render has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
            Open

                render: function () {
                    var properties = window.matchSetting[this.props.domain][this.props.id];
                    var tip = properties.info ? (
                            <i className="glyphicon glyphicon-question-sign" data-tip data-multiline={true} data-for={this.props.uniqueID}/>
                        ) : '';
            Severity: Minor
            Found in source/web/components/settings-panel.jsx - About 3 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

            actions has 25 functions (exceeds 20 allowed). Consider refactoring.
            Open

            var actions = {
                loadKeyboardLayout: function () {
                    dispatcher.dispatch({
                        type: constants.LOAD_KEYBOARD_LAYOUT
                    });
            Severity: Minor
            Found in source/web/actions.js - About 2 hrs to fix

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

                  render: function () {
                      var cycles = [];
                      var cy = this.state.preset.cycles;
                      for (var i = 0; i < cy.length; i++) {
                          if (cy.length % 2 === 0 || i < cy.length - 1) {
              Severity: Major
              Found in source/web/components/cycles/view.jsx - About 2 hrs to fix

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

                    renderConfigure: function () {
                        var state = this.props.state;
                        var subView = viewData[state.changer.view];
                        var content = [];
                        subView.options.forEach(function (item, index) {
                Severity: Major
                Found in source/web/components/dialogs/bind-changer.jsx - About 2 hrs to fix

                  File main.jsx has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // external
                  
                  var manta = require('dota2-manta-config-engine');
                  
                  // internal
                  Severity: Minor
                  Found in source/web/main.jsx - About 2 hrs to fix

                    Function render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        render: function () {
                            var controls = [];
                            for (var i = 0; i < this.state.preset.layouts.length; i++) {
                                controls.push(
                                    <LayoutSelector update={this.update} id={i}/>
                    Severity: Minor
                    Found in source/web/components/preset.jsx - About 1 hr to fix

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

                          purge: function () {
                              _state = {
                                  currentLayout: 0,
                                  changer: {
                                      key: '',
                      Severity: Minor
                      Found in source/web/store.js - About 1 hr to fix

                        Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            render: function () {
                                return (
                                    <div className="preset">
                                        <div className="jumbotron header">
                                            <div className="container">
                        Severity: Minor
                        Found in source/web/components/cycle.jsx - About 1 hr to fix

                          Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              render: function () {
                                  return (
                                      <div className="preset">
                                          <div className="jumbotron header">
                                              <div className="container">
                          Severity: Minor
                          Found in source/web/components/chatwheel.jsx - About 1 hr to fix

                            Function render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                render: function () {
                                    return (
                                        <div>
                                            <nav className="navbar navbar-default navbar-fixed-top navbar-inverse">
                                                <div className="container">
                            Severity: Minor
                            Found in source/web/components/layout.jsx - About 1 hr to fix

                              Function render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  render: function () {
                                      var presetList = [];
                                      for (var i = 0; i < this.state.presets.length; i++) {
                                          presetList.push(
                                              <Item id={this.state.presets[i]}/>
                              Severity: Minor
                              Found in source/web/components/presets-load.jsx - About 1 hr to fix

                                Function renderContent has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    renderContent: function (p, classNames, options) {
                                        var button = options.interactive ?
                                            (
                                                <button onClick={this.remove} type="button" className="btn btn-danger btn-block">
                                                    <i className="glyphicon glyphicon-trash"/> Remove
                                Severity: Minor
                                Found in source/web/components/chatwheels.jsx - About 1 hr to fix

                                  Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      render: function () {
                                          var commands = [];
                                          for (var i = 0; i < this.props.data.length; i++) {
                                              commands.push(
                                                  <Command key={i} data={this.props.data[i]} id={i} cycle={this.props.id} action={true}/>
                                  Severity: Minor
                                  Found in source/web/components/cycles/cycle.jsx - About 1 hr to fix

                                    Function renderMain has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        renderMain: function () {
                                            var content = [];
                                            viewData.forEach(function (node, index) {
                                                var _onClick = function () {
                                                    if (node.action) {
                                    Severity: Minor
                                    Found in source/web/components/dialogs/bind-changer.jsx - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language