Showing 163 of 163 total issues
Function default
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (ComposedComponent) {
function mapStateToProps(state) {
return {
hasAlert: state.error.hasAlert,
message: state.error.message,
Function renderComponent
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderComponent() {
switch (this.props.item.targetType) {
case TARGET_TYPES.IMAGE:
return (
<Image
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<AppBar
showMenuIconButton={false}
title={config.authorName}
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let publishActionIcon;
let statusIcon;
if (this.props.accepted) {
publishActionIcon = <ActionVisibilityOff name="in-visible-icon" />;
Function default
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(ComposedComponent) {
function mapStateToProps(state) {
return {
authenticated: state.auth.authenticated
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { handleSubmit, submitting, fields: { image, caption } } = this.props;
return (
<div className={styles.root}>
Function default
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function (state = [], action) {
switch (action.type) {
case FETCH_ITEMS:
return action.payload.items;
- 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 default
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (ComposedComponent) {
class ProgressBar extends Component {
constructor(props) {
super(props);
this.state = { loading: true };
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { editorState } = this.state;
return (
<div className={styles.root} onBlur={this.handleUpdate} >
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { handleSubmit, submitting, fields: { email, password } } = this.props;
return(
<form onSubmit={handleSubmit(this.handleSubmit)} className={styles.root}>
<h2 className={styles.heading}>Sign In</h2>
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.props.loading) {
return (
<section>
<Helmet title="Projects" />
Function InlineStyleControls
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const InlineStyleControls = (props) => {
const currentStyle = props.editorState.getCurrentInlineStyle();
return (
<div className={styles.root}>
{INLINE_STYLES.map(type =>
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
if (props.value) {
const blocks = convertFromRaw(JSON.parse(props.value));
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { handleSubmit, submitting, fields: { twitterId } } = this.props;
return (
<div className={styles.root}>
<TextField
Function default
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function(ComposedComponent) {
function mapStateToProps(state) {
return {
authenticated: state.auth.authenticated
- 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
Method save_from_associations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save_from_associations(params)
ActiveRecord::Base.transaction do
delete_unnecessary_items!(params[ITEMS_ATTRIBUTES]) if id
delete_unnecessary_tags!(params[TAGGINGS_ATTRIBUTES]) if id
- 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
Method save_from_associations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def save_from_associations(params)
ActiveRecord::Base.transaction do
delete_unnecessary_tags!(params[TAGGINGS_ATTRIBUTES]) if id
trim_tagging_attributes!(params[TAGGINGS_ATTRIBUTES])
if params['image']&.start_with?('data')
- 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 [
...state.slice(0, action.payload.sortRank),
...succItem,
...subject,
...state.slice(action.payload.sortRank + 2),
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return state;