Showing 34 of 108 total issues
File bind-changer.jsx
has 543 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var store = require('../../store');
var actions = require('../../actions');
var Markdown = require('react-markdown');
var manta = require('dota2-manta-config-engine');
Function render
has 215 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
return (
<div className="home">
<div className="jumbotron header">
<div className="container">
Function commandInfo
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
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'];
Function commandInfo
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
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'];
- Read upRead up
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
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');
Function render
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
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}/>
) : '';
Function render
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
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}/>
) : '';
- Read upRead up
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
Open
var actions = {
loadKeyboardLayout: function () {
dispatcher.dispatch({
type: constants.LOAD_KEYBOARD_LAYOUT
});
Function render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
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) {
Function renderConfigure
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderConfigure: function () {
var state = this.props.state;
var subView = viewData[state.changer.view];
var content = [];
subView.options.forEach(function (item, index) {
File main.jsx
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// external
var manta = require('dota2-manta-config-engine');
// internal
Function render
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
var controls = [];
for (var i = 0; i < this.state.preset.layouts.length; i++) {
controls.push(
<LayoutSelector update={this.update} id={i}/>
Function purge
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
purge: function () {
_state = {
currentLayout: 0,
changer: {
key: '',
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
return (
<div className="preset">
<div className="jumbotron header">
<div className="container">
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
return (
<div className="preset">
<div className="jumbotron header">
<div className="container">
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
return (
<div>
<nav className="navbar navbar-default navbar-fixed-top navbar-inverse">
<div className="container">
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
var presetList = [];
for (var i = 0; i < this.state.presets.length; i++) {
presetList.push(
<Item id={this.state.presets[i]}/>
Function renderContent
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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}/>
Function renderMain
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderMain: function () {
var content = [];
viewData.forEach(function (node, index) {
var _onClick = function () {
if (node.action) {