lifechurch/melos

View on GitHub

Showing 17 of 54 total issues

Function withFacebook has 116 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function withFacebook(WrappedComponent) {
  class Facebook extends Component {
    constructor(props) {
      super(props)
      this.state = {
Severity: Major
Found in src/components/auth/hocs/withFacebook/index.js - About 4 hrs to fix

    Function withGoogle has 100 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function withGoogle(WrappedComponent) {
      class Google extends Component {
        constructor(props) {
          super(props)
          this.state = {
    Severity: Major
    Found in src/components/auth/hocs/withGoogle/index.js - About 4 hrs to fix

      Function withDebouncedInput has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function withDebouncedInput(WrappedComponent) {
        class DebouncedInput extends Component {
          constructor(props) {
            super(props)
            this.state = {
      Severity: Major
      Found in src/components/forms/hocs/withDebouncedInput/index.js - About 2 hrs to fix

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

          render() {
            const {
                    placeholder,
                    src,
                    width,
        Severity: Major
        Found in src/components/images/LazyImage/index.js - About 2 hrs to fix

          Function withThirdPartyAuth has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function withThirdPartyAuth(WrappedComponent) {
            class ThirdPartyAuth extends Component {
              constructor(props) {
                super(props)
                this.state = {
          Severity: Minor
          Found in src/components/auth/hocs/withThirdPartyAuth/index.js - About 1 hr to fix

            Function VerticalSpace has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function VerticalSpace(props) {
              const { space, children, columns } = props
            
              const propsToPass = Object.assign({}, props)
              delete propsToPass.space
            Severity: Minor
            Found in src/components/layouts/VerticalSpace/index.js - About 1 hr to fix

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

              function Avatar(props) {
                const { placeholderText, src, width, link, onClick } = props
              
                const placeholder = (
                  <Div
              Severity: Minor
              Found in src/components/user/Avatar/index.js - About 1 hr to fix

                Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  render() {
                    const {
                            placeholder,
                            src,
                            width,
                Severity: Minor
                Found in src/components/images/LazyImage/index.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 Installation has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const Installation = (props) => {
                  const {
                        maintainer,
                        command,
                        npm,
                Severity: Minor
                Found in stories/Docs.js - About 1 hr to fix

                  Function InputTopLabel has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function InputTopLabel(props) {
                    const {
                          onChange: handleChange,
                          onKeyUp: handleKeyUp,
                          value,
                  Severity: Minor
                  Found in src/components/forms/InputTopLabel/index.js - About 1 hr to fix

                    Function User has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function User(props) {
                      const {
                         avatarLetter,
                         avatarSrc,
                         avatarWidth,
                    Severity: Minor
                    Found in src/components/user/User/index.js - About 1 hr to fix

                      Function ButtonStroke has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function ButtonStroke(props) {
                        const { left, right, theme, children, color, textColor } = props
                      
                        const className = glamor.css(getThemeForComponent('ButtonStroke', theme, props, (t) => {
                          return {
                      Severity: Minor
                      Found in src/components/links/ButtonStroke/index.js - About 1 hr to fix

                        Function Button has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function Button(props) {
                          const { left, right, theme, children, color, textColor } = props
                        
                          const className = glamor.css(getThemeForComponent('Button', theme, props, (t) => {
                            return {
                        Severity: Minor
                        Found in src/components/links/Button/index.js - About 1 hr to fix

                          Function ButtonMajor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function ButtonMajor(props) {
                            const { left, right, theme, children, color, textColor } = props
                          
                            const className = glamor.css(getThemeForComponent('ButtonMajor', theme, props, (t) => {
                              return {
                          Severity: Minor
                          Found in src/components/links/ButtonMajor/index.js - About 1 hr to fix

                            Function Usage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const Usage = (props) => {
                              const {
                                    importString,
                                    children
                                } = props
                            Severity: Minor
                            Found in stories/Docs.js - About 1 hr to fix

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

                                render() {
                                  const { show, message } = this.props
                                  const { ready, isClosed } = this.state
                              
                                  return (
                              Severity: Minor
                              Found in src/components/banners/Error/index.js - About 1 hr to fix

                                Function Link has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function Link({ to, href, onClick, children, className, target }) {
                                  let useClientRouting = false
                                
                                  const linkProps = {
                                    className,
                                Severity: Minor
                                Found in src/components/links/Link/index.js - About 25 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

                                Severity
                                Category
                                Status
                                Source
                                Language