Showing 26 of 26 total issues
Function render
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
public render(): JSX.Element {
const { props, state, context } = this;
const { textField, layouts, keyboardKeyHeight, keyboardKeyWidth, keyboardKeySymbolSize, automatic, correctorName, disableEffects } = props;
const { value, layout: stateLayout, capsLock } = state;
const { muiTheme } = context;
- 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 Keyboard.tsx
has 442 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as React from 'react';
import * as PropTypes from 'prop-types';
import bind from 'bind-decorator';
import Dialog from 'material-ui/Dialog';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
Function render
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
public render(): JSX.Element {
const { props, state, context } = this;
const { textField, layouts, keyboardKeyHeight, keyboardKeyWidth, keyboardKeySymbolSize, automatic, correctorName, disableEffects } = props;
const { value, layout: stateLayout, capsLock } = state;
const { muiTheme } = context;
Function shouldComponentUpdate
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public shouldComponentUpdate(props: KeyboardProps, state: KeyboardState): boolean {
const { textField } = props;
const { textField: thisTextField } = this.props;
if(this.state.value !== state.value) {
return constants.boolTrue;
- 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 shouldComponentUpdate
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public shouldComponentUpdate(props: KeyboardProps, state: KeyboardState): boolean {
const { textField } = props;
const { textField: thisTextField } = this.props;
if(this.state.value !== state.value) {
return constants.boolTrue;
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public render(): JSX.Element {
const { keyboardKey: key, keyboardKeyHeight: height, keyboardKeyWidth: width, keyboardKeySymbolSize: size, disableEffects } = this.props;
let flatButtonProps: any = {
style: {
height: height,
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public render(): JSX.Element {
const { keyboardKey: key, keyboardKeyHeight: height, keyboardKeyWidth: width, keyboardKeySymbolSize: size, disableEffects } = this.props;
let flatButtonProps: any = {
style: {
height: height,
- 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 componentDidUpdate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public componentDidUpdate(props: KeyboardProps, state: KeyboardState): void {
const { automatic } = this.props;
const open: boolean = automatic ? this.state.open! : this.props.open!;
const prev: boolean = automatic ? state.open! : props.open!;
if(open !== prev) {
- 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
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolFalse;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolTrue;
Avoid too many return
statements within this function. Open
return constants.boolFalse;