tsurupin/portfolio

View on GitHub

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,
Severity: Minor
Found in frontend/src/shared/containers/Alert/index.js - About 1 hr to fix

    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
    Severity: Minor
    Found in frontend/src/cms/components/posts/forms/Item/Form/index.js - About 1 hr to fix

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

        render() {
          return (
            <AppBar
              showMenuIconButton={false}
              title={config.authorName}
      Severity: Minor
      Found in frontend/src/client/components/NavigationBar/index.js - About 1 hr to fix

        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" />;
        Severity: Minor
        Found in frontend/src/cms/components/projects/indexes/Item/index.js - About 1 hr to fix

          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
          Severity: Minor
          Found in frontend/src/cms/containers/shared/Authentication/index.js - About 1 hr to fix

            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}>
            Severity: Minor
            Found in frontend/src/cms/components/posts/forms/Item/Form/Image/index.js - About 1 hr to fix

              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;
              
              
              Severity: Minor
              Found in frontend/src/shared/reducers/items.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 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 };
              Severity: Minor
              Found in frontend/src/shared/containers/ProgressBar/index.js - About 1 hr to fix

                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} >
                Severity: Minor
                Found in frontend/src/shared/components/textEditors/Editor/index.js - About 1 hr to fix

                  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>
                  Severity: Minor
                  Found in frontend/src/cms/containers/authors/SignIn/index.js - About 1 hr to fix

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

                      render() {
                        if (this.props.loading) {
                          return (
                            <section>
                              <Helmet title="Projects" />
                    Severity: Minor
                    Found in frontend/src/client/containers/projects/Index/index.js - About 1 hr to fix

                      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));
                        Severity: Minor
                        Found in frontend/src/shared/components/textEditors/Editor/index.js - About 1 hr to fix

                          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
                          Severity: Minor
                          Found in frontend/src/cms/components/posts/forms/Item/Form/Twitter/index.js - About 1 hr to fix

                            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
                            Severity: Minor
                            Found in frontend/src/cms/containers/shared/Authentication/index.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

                            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
                            
                            
                            Severity: Minor
                            Found in app/models/post/form.rb - 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

                            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')
                            Severity: Minor
                            Found in app/models/project/form.rb - 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

                            Avoid too many return statements within this function.
                            Open

                                    return [
                                      ...state.slice(0, action.payload.sortRank),
                                      ...succItem,
                                      ...subject,
                                      ...state.slice(action.payload.sortRank + 2),
                            Severity: Major
                            Found in frontend/src/shared/reducers/items.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return state;
                              Severity: Major
                              Found in frontend/src/shared/reducers/items.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return state;
                                Severity: Major
                                Found in frontend/src/shared/reducers/items.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language