Showing 36 of 74 total issues
File selectors.ts
has 510 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// @todo: readd NpmInstallPlugin
// @todo: clean up this file (extra functions, commented out code, etc.)
import path from 'path';
// import address from 'address';
import webpack, { Loader } from 'webpack';
Function reducer
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const reducer = (state: State, action: Action): State => {
switch (action.type) {
case 'INPUT':
// Only handle input on configure step.
if (state.step !== 'configure') {
Function selectWebpackConfig
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const selectWebpackConfig = (
state: BuildConfig,
): webpack.Configuration => {
let entry = selectWebpackEntry(state);
Function reducer
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
const reducer = (state: State, action: Action): State => {
switch (action.type) {
case 'INPUT':
// Only handle input on configure step.
if (state.step !== 'configure') {
- 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
Function toJunction
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function toJunction<E extends { [key: string]: any }>(
_events: Events<E> | Combiner = {} as Events<E>,
_combine: Combiner = id,
) {
let events: Events<E>, combine: Combiner;
Function selectStyleLoaders
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const selectStyleLoaders = (
state: BuildConfig,
cssLoaderOptions: object,
preProcessor?: string,
) => {
Function load
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
static load(target: string) {
const filename = App.resolve(target);
const oldNodeEnv = process.env.NODE_ENV;
process.env.NODE_ENV = 'production';
Function reducer
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const reducer: EddyReducer<State, Action> = (
state = initialState('/', null),
action,
) => {
switch (action.type) {
Function reducer
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const reducer: EddyReducer<State, Action> = (
state = initialState('/', null),
action,
) => {
switch (action.type) {
Function observeDelta
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function observeDelta<A extends { type: string }, S>(
...sources: Delta<A, S>[]
): Middleware<Ext, S> {
return store => {
const action$: Stream<A, never> = new (Kefir as any).Stream().setName(
Function selectEnvPlugins
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const selectEnvPlugins = (state: BuildConfig) => {
const plugins = state.watch
? [
// If you require a missing module and then `npm install` it, you still have
// to restart the development server for Webpack to discover it. This plugin
Function exec
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const exec: Delta<Action, State> = (action$, state$) => {
const glob$ = glob.delta(
action$.thru(ofType(glob.actions.format.request)),
state$.map(state => ({
cwd: state.cwd,
Function addHotReload
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
const addHotReload = (
entry: webpack.Configuration['entry'],
): webpack.Configuration['entry'] => {
const client = require.resolve('react-dev-utils/webpackHotDevClient');
- 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
Function useDelta
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useDelta = <S, A extends Action<string>>(
reducer: Reducer<S, A> | EddyReducer<S, A>,
initialState: S,
delta: Delta<A, S> = defaultDelta,
) => {
Function toEmitFromJunction
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
toEmitFromJunction(
this: any,
element: any,
expected: any,
cb: (a: any, b: any, c: any) => void = noop,
Function spawn
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
spawn(bin: string, command: string) {
this.process = {
stdout: '',
closed: false,
code: null
Function withRef$
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
) => (
WrappedComponent: React.ForwardRefRenderFunction<E, P> | React.ElementType<P>,
) => {
// @TODO(mAAdhaTTah) why isn't this type working?
const Target = wrap(WrappedComponent) as any;
Function format
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const format = (
path: string,
buffer?: Buffer,
): Observable<FormatResult, FormatError> => {
const buffer$: Observable<Buffer, NodeJS.ErrnoException> = buffer
Function toEmitFromDelta
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
this: jest.MatcherContext,
delta: any,
expected: any,
cb: (a: any, b: any, c: any) => void = noop,
{ timeLimit = 10000 } = {},
Function toEmitFromJunction
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
this: any,
element: any,
expected: any,
cb: (a: any, b: any, c: any) => void = noop,
{ timeLimit = 10000 } = {},