Showing 70 of 724 total issues
File board-component.jsx
has 780 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const React = require('react');
const PropTypes = require('prop-types');
const {default: Hammer} = require('react-hammerjs');
const {INPUT_MOVE, INPUT_END} = (typeof window === 'undefined') ? {} : require('hammerjs');
const {default: Measure} = require('react-measure');
Function step
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
Open
step() {
this.inputExists = false;
switch (this.config.type) {
case 'empty': {
- 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 block-configs.js
has 549 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const util = require('./util');
module.exports = {
empty: {
type: 'empty',
File stages.js
has 509 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-env node, mocha */
/* eslint no-unused-expressions: 'off' */
const chai = require('chai');
const chaiHttp = require('chai-http');
File stage.js
has 469 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* global ga */
const $ = require('jquery');
const assert = require('assert');
const React = require('react');
BoardComponent
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class BoardComponent extends React.Component {
static propTypes = {
status: PropTypes.string.isRequired,
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
Function render
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<Hammer
onPan={this.handlePan}
onPanStart={this.handlePan}
Function step
has 151 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
step() {
this.inputExists = false;
switch (this.config.type) {
case 'empty': {
Function constructor
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor({config, onClickExit}) {
this.config = Object.assign({}, config);
this.onClickExit = onClickExit;
this.caseIndex = 0;
Function validateSubmission
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.validateSubmission = (submission) => {
if (typeof submission.stage !== 'string') {
return {pass: false, message: 'stage data is missing'};
}
Function constructor
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(props, state) {
super(props, state);
this.dataAnimationResolvers = new WeakMap();
Function ioGenerator
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ioGenerator: (random) => {
const iterations = (n) => (
10000 % (n - 1) === 0 ? n - 1 : 10000 % (n - 1)
);
Stage
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Stage {
constructor({config, onClickExit}) {
this.config = Object.assign({}, config);
this.onClickExit = onClickExit;
Function exports
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (config) => {
config.set({
basePath: '',
frameworks: ['mocha'],
files: [
Function render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<g transform={`translate(${this.props.x}, ${this.props.y})`}>
<rect
width="150"
Function render
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
return (
<g>
{/* click event capture */}
<rect
Function constructor
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(configs) {
this.configs = configs;
this.$stage = $('.stage');
this.stageIndex = 0;
this.stagePrototype = this.$stage.clone();
File board.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const Block = require('./block');
const Data = require('./data');
const blockConfigs = require('./block-configs');
const {nop} = require('./util');
const EventEmitter = require('events');
Board
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Board extends EventEmitter {
constructor(config) {
super();
this.height = config.height;
Function run
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
run(inputValue) {
this.input(inputValue);
const clockUp = () => {
while (true) {
- 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"