jaredpalmer/react-email-workflow

View on GitHub

Showing 29 of 29 total issues

Function createHTML has 418 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function createHTML(data, cb) {
  const presetOptions = {
    shelly: {
      title: 'ShellyPalmer',
      url: 'https://www.shellypalmer.com',
Severity: Major
Found in services/premail/createHTML.js - About 2 days to fix

    File createHTML.js has 470 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    const moment = require('moment');
    
    function button({
    Severity: Minor
    Found in services/premail/createHTML.js - About 7 hrs to fix

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

        render() {
          const {
            isLoading,
            html,
            error,
      Severity: Major
      Found in client/containers/Preview.js - About 5 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  <Block
                    flex='1'
                    marginBottom='.5rem'
                    marginRight='.5rem'
                  >
        Severity: Major
        Found in client/containers/ElementList.js and 1 other location - About 4 hrs to fix
        client/containers/ElementList.js on lines 102..113

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  <Block
                    flex='1'
                    marginBottom='.5rem'
                    marginRight='.5rem'
                  >
        Severity: Major
        Found in client/containers/ElementList.js and 1 other location - About 4 hrs to fix
        client/containers/ElementList.js on lines 55..66

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

          render () {
            const { elements, actions, connectDropTarget, ...other } = this.props
            return connectDropTarget(
              <Block width='600px'>
                {elements.map((card, i) => {
        Severity: Major
        Found in client/containers/ElementList.js - About 3 hrs to fix

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

            render() {
              const { meta, metaData } = this.props;
              return (
                <Block>
                  <Block
          Severity: Major
          Found in client/containers/Meta.js - About 2 hrs to fix

            Function api has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function api (__DEV__) {
              const server = express()
              server.disable('x-powered-by')
              server.use(helmet())
              server.use(bodyParser.urlencoded({ extended: true }))
            Severity: Major
            Found in web/index.js - About 2 hrs to fix

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

                render () {
                  const { id, title, content, author, url, edit, extract } = this.props
                  return (
                    <Block>
                      <Row>
              Severity: Major
              Found in client/components/Url.js - About 2 hrs to fix

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

                  render () {
                    return (
                      <Col>
                        <Row
                          height={L.gridUnit * 6.25}
                Severity: Minor
                Found in client/containers/App.js - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              <Input
                                placeholder="Enter the subject line...(keep it short!)"
                                value={metaData.subject}
                                onChange={(e) => meta({ subject: e.target.value })}
                                style={{
                  Severity: Major
                  Found in client/containers/Meta.js and 1 other location - About 1 hr to fix
                  client/containers/Meta.js on lines 22..34

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 73.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              <select
                                placeholder="Preset"
                                value={metaData.preset}
                                onChange={(e) => meta({ preset: e.target.value })}
                                style={{
                  Severity: Major
                  Found in client/containers/Meta.js and 1 other location - About 1 hr to fix
                  client/containers/Meta.js on lines 46..55

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 73.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                    render () {
                      const { id, hasCopied, text, onCopy, ...other } = this.props
                      return (
                        <div
                          id={id}
                  Severity: Minor
                  Found in client/components/Copy.js - About 1 hr to fix

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

                      render() {
                        const { style, rows, ...rest } = this.props;
                        const border = this.state.focused
                          ? '1px solid #a6aebb'
                          : '1px solid #edeff1';
                    Severity: Minor
                    Found in client/components/Input.js - About 1 hr to fix

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

                        render () {
                          const { children, onClick, small, ...rest } = this.props
                          return (
                            <div
                              role='button'
                      Severity: Minor
                      Found in client/components/Button.js - About 1 hr to fix

                        Function configureStore has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function configureStore () {
                          const persistedState = loadState()
                          const middlewares = [thunk.withExtraArgument({ axios })]
                        
                          const store = createStore(
                        Severity: Minor
                        Found in client/store/configureStore.js - About 1 hr to fix

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

                            render () {
                              const { card, isDragging, connectDragSource, connectDropTarget, edit, destroy, extract } = this.props
                              const opacity = isDragging ? 0 : 1
                          
                              return connectDragSource(connectDropTarget(
                          Severity: Minor
                          Found in client/components/Card.js - About 1 hr to fix

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

                            function start () {
                              const rabbit = jackrabbit(RABBIT_URL)
                              const exchange = rabbit.default()
                              logger.log({ type: 'info', message: 'serving premail service' })
                            
                            
                            Severity: Minor
                            Found in services/premail/index.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                    if (e) {
                                      const error_code = e && e.data && (e.data.error_code || 500);
                                      const error_message =
                                        e && e.data && (e.data.error_message || 'Something went wrong');
                                      const data = {
                              Severity: Major
                              Found in web/extract.js - About 1 hr to fix

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                            {card.kind === 'text' ? <Text id={card.id} content={card.content} edit={edit} /> : null}
                                Severity: Major
                                Found in client/components/Card.js and 2 other locations - About 50 mins to fix
                                client/components/Card.js on lines 80..80
                                client/components/Card.js on lines 82..82

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 52.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Severity
                                Category
                                Status
                                Source
                                Language