acdlite/flummox

View on GitHub

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 {
Severity: Minor
Found in src/__tests__/Flux-test.js - About 6 hrs to fix

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 {
Severity: Minor
Found in src/__tests__/Store-test.js - About 6 hrs to fix

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';

Severity: Minor
Found in src/addons/__tests__/fluxMixin-test.js - About 3 hrs to fix

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;
Severity: Minor
Found in src/Flux.js - About 1 hr 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

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,
Severity: Minor
Found in docs/src/server/appView.js - About 1 hr to fix

Function deserialize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  deserialize(serializedState) {
    let stateMap;

    try {
      stateMap = JSON.parse(serializedState);
Severity: Minor
Found in src/Flux.js - About 1 hr 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

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);
Severity: Minor
Found in src/addons/reactComponentMethods.js - About 1 hr to fix

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) {
Severity: Minor
Found in docs/src/shared/components/AppNav.js - About 1 hr to fix

Function handler has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  handler(payload) {
    const {
      body,
      actionId,
      'async': _async,
Severity: Minor
Found in src/Store.js - About 1 hr to fix

Function deserialize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  deserialize(serializedState) {
    let stateMap;

    try {
      stateMap = JSON.parse(serializedState);
Severity: Minor
Found in src/Flux.js - About 1 hr to fix

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;
Severity: Minor
Found in src/Flux.js - About 1 hr to fix

Function dispatchAsync has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  dispatchAsync(actionId, promise, actionArgs) {
    const payload = {
      actionId,
      async: 'begin'
    };
Severity: Minor
Found in src/Flux.js - About 1 hr to fix

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

  render() {
    const {
      component,
      flexDirection,
      alignItems,
Severity: Minor
Found in docs/src/shared/components/View.js - About 1 hr to fix

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);

Severity: Minor
Found in src/Flux.js - About 1 hr to fix

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);
Severity: Minor
Found in src/addons/reactComponentMethods.js - About 45 mins 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

Function handler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  handler(payload) {
    const {
      body,
      actionId,
      'async': _async,
Severity: Minor
Found in src/Store.js - About 35 mins 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

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);
      }
Severity: Minor
Found in src/Actions.js - About 25 mins 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

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];
Severity: Minor
Found in src/Store.js - About 25 mins 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

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);

Severity: Minor
Found in src/Flux.js - About 25 mins 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

Severity
Category
Status
Source
Language