Showing 19 of 65 total issues
File Flux-test.js
has 442 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Flux, Store, Actions } from '../Flux';
import sinon from 'sinon';
function createSerializableStore(serializedState) {
return class SerializableStore extends Store {
- Create a ticketCreate a ticket
File Store-test.js
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Store, Flux, Actions } from '../Flux';
import sinon from 'sinon';
describe('Store', () => {
class ExampleStore extends Store {
- Create a ticketCreate a ticket
File fluxMixin-test.js
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
import fluxMixin from '../fluxMixin';
import { Flummox, Store, Actions } from '../../Flux';
import addContext from './addContext';
import sinon from 'sinon';
- Create a ticketCreate a ticket
Function serialize
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
serialize() {
const stateTree = {};
for (let key in this._stores) {
if (!this._stores.hasOwnProperty(key)) continue;
- Read upRead up
- Create a ticketCreate a ticket
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
Function default
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(app) {
app.use(function *() {
const router = Router.create({
routes: routes,
location: this.url,
- Create a ticketCreate a ticket
Function deserialize
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
deserialize(serializedState) {
let stateMap;
try {
stateMap = JSON.parse(serializedState);
- Read upRead up
- Create a ticketCreate a ticket
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
Function connectToStores
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
connectToStores(stateGetterMap = {}, stateGetter = null) {
const flux = this.getFlux();
const getStore = (key) => {
const store = flux.getStore(key);
- Create a ticketCreate a ticket
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { children, title, href, level, ...props } = this.props;
let subNav;
if (children) {
- Create a ticketCreate a ticket
Function handler
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
handler(payload) {
const {
body,
actionId,
'async': _async,
- Create a ticketCreate a ticket
Function deserialize
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
deserialize(serializedState) {
let stateMap;
try {
stateMap = JSON.parse(serializedState);
- Create a ticketCreate a ticket
Function serialize
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
serialize() {
const stateTree = {};
for (let key in this._stores) {
if (!this._stores.hasOwnProperty(key)) continue;
- Create a ticketCreate a ticket
Function dispatchAsync
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
dispatchAsync(actionId, promise, actionArgs) {
const payload = {
actionId,
async: 'begin'
};
- Create a ticketCreate a ticket
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
component,
flexDirection,
alignItems,
- Create a ticketCreate a ticket
Function createActions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
createActions(key, _Actions, ...constructorArgs) {
if (!(_Actions.prototype instanceof Actions) && _Actions !== Actions) {
if (typeof _Actions === 'function') {
const className = getClassName(_Actions);
- Create a ticketCreate a ticket
Function connectToStores
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
connectToStores(stateGetterMap = {}, stateGetter = null) {
const flux = this.getFlux();
const getStore = (key) => {
const store = flux.getStore(key);
- Read upRead up
- Create a ticketCreate a ticket
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
Function handler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
handler(payload) {
const {
body,
actionId,
'async': _async,
- Read upRead up
- Create a ticketCreate a ticket
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
Function _dispatch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_dispatch(actionId, body, args, methodName) {
if (typeof this.dispatch === 'function') {
if (typeof body !== 'undefined') {
this.dispatch(actionId, body, args);
}
- Read upRead up
- Create a ticketCreate a ticket
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
Function _bindAsyncHandlers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_bindAsyncHandlers(asyncHandlers) {
for (let key in asyncHandlers) {
if (!asyncHandlers.hasOwnProperty(key)) continue;
const handler = asyncHandlers[key];
- Read upRead up
- Create a ticketCreate a ticket
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
Function createActions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
createActions(key, _Actions, ...constructorArgs) {
if (!(_Actions.prototype instanceof Actions) && _Actions !== Actions) {
if (typeof _Actions === 'function') {
const className = getClassName(_Actions);
- Read upRead up
- Create a ticketCreate a ticket
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"