Showing 35 of 163 total issues
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;
Avoid too many return
statements within this function. Open
return [
...state.slice(0, action.payload.sortRank),
...state.slice(action.payload.sortRank + 1),
...bottomItem,
];
Method show
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show
cache_name = "cached_posts/#{params[:id]}"
cache_name += "?#{params[:previewing]}" if params[:previewing]
json = rails_cache(cache_name) do
- 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"