initiatived21/d21

View on GitHub

Showing 63 of 611 total issues

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

const mapDispatchToProps = function(dispatch, ownProps) {
  const { min, max } = ownProps

  return {
    onChange: function(formId, attribute, submodel, value) {
Severity: Minor
Found in client/app/Inputs/containers/NumberInput.js - About 1 hr to fix

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

      render() {
        const currentPage = `${this.props.controller}#${this.props.action}`
    
        return (
          <nav className="c-primary-nav">
    Severity: Minor
    Found in client/app/PageHeader/components/PrimaryNav.jsx - About 1 hr to fix

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

        render() {
          const {
            pledge_id, forms, isPreview, userIsInitiator,
            isDraft, activateAction, userConfirmed, renderReportForm, className,
            showSignForm
      Severity: Minor
      Found in client/app/Sidebar/components/PledgeSidebar.jsx - About 1 hr to fix

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

        const mapStateToProps = function(state, ownProps) {
          const formId = ownProps.formId
          const attrs = state.rform[ownProps.formId]
        
          let errors = null
        Severity: Minor
        Found in client/app/Inputs/containers/ImageInput.js - About 1 hr to fix

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

            render() {
              const { results, query, filter, resultCount, isLoading, onButtonClick } = this.props
          
              const showMoreButton = resultCount > results.length
          
          
          Severity: Minor
          Found in client/app/Search/components/PaginatedSearchResults.jsx - About 1 hr to fix

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

              render() {
                const {
                  id, reason, created_at
                } = this.props
            
            
            Severity: Minor
            Found in client/app/SigneeList/components/Signee.jsx - About 1 hr to fix

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

                I18n.lookup = function(scope, options) {
                  options = this.prepareOptions(options);
              
                  var locales = this.locales.get(options.locale).slice()
                    , requestedLocale = locales[0]
              Severity: Minor
              Found in client/vendor/i18n/i18n.js - About 1 hr to fix

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

                  render() {
                    const { imagePath, name, className, large } = this.props
                
                    const avatarName = `Avatar ${name}`
                
                
                Severity: Minor
                Found in client/app/Avatar/components/Avatar.jsx - About 1 hr to fix

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

                    render() {
                      return (
                        <Provider store={store}>
                          <div className="o-wrapper">
                            {/* Layout M */}
                  Severity: Minor
                  Found in client/app/NewPledge/components/NewPledge.jsx - About 1 hr to fix

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

                    function cropImage(originalImg, crop, maxWidth, maxHeight) {
                      const
                        imageWidth = originalImg.naturalWidth,
                        imageHeight = originalImg.naturalHeight,
                    
                    
                    Severity: Minor
                    Found in client/app/lib/image_processing/cropImage.js - About 1 hr to fix

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

                        render() {
                          const { formData, isSubmitting, id, handleResponse } = this.props
                      
                          return (
                            <Form
                      Severity: Minor
                      Found in client/app/CommentList/components/AnswerForm.jsx - About 1 hr to fix

                        Function mapDispatchToProps has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const mapDispatchToProps = function(dispatch, ownProps) {
                          const { min, max } = ownProps
                        
                          return {
                            onChange: function(formId, attribute, submodel, value) {
                        Severity: Minor
                        Found in client/app/Inputs/containers/NumberInput.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

                        Function calculateDefaultCrop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function calculateDefaultCrop(imgWidth, imgHeight, cropAspectRatio) {
                          let cropWidth, cropHeight, cropX, cropY
                          const imageAspectRatio = imgWidth / imgHeight
                        
                          if (imgWidth > imgHeight) {
                        Severity: Minor
                        Found in client/app/lib/image_processing/calculateDefaultCrop.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

                        Function fetchMoreResults has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        function fetchMoreResults (dispatch, query, filter, offset, limit) {
                        Severity: Minor
                        Found in client/app/Search/containers/PaginatedSearchResultsContainer.jsx - About 35 mins to fix

                          Method to_one has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            def self.to_one mailer_class, mailing_name, recipient, time, *mailing_args
                          Severity: Minor
                          Found in app/lib/mail_delivery.rb - About 35 mins to fix

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

                              render() {
                                const {
                                  imageState, originalImage, originalImageWidth, originalImageHeight, filename,
                                  crop, croppedImageUrl, previewArea, onDropFile, handleChangeCrop,
                                  handleFinishCrop, onCancelClick, onRemoveFileClick, className, type
                            Severity: Minor
                            Found in client/app/Inputs/components/ImageInputComponent.jsx - 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

                            Function mapStateToProps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const mapStateToProps = function(state, ownProps) {
                              const formId = ownProps.formId
                              const attrs = state.rform[ownProps.formId]
                            
                              let errors = null
                            Severity: Minor
                            Found in client/app/Inputs/containers/ImageInput.js - 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

                            Function _nameOrAnonymous has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                              get _nameOrAnonymous() {
                                let string
                                if (this.props.anonymous && !this.props.showPrivateData) {
                                  string = this.t('.anonymous')
                                }
                            Severity: Minor
                            Found in client/app/SigneeList/components/Signee.jsx - 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

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

                              render() {
                                const { results, query, filter, resultCount, isLoading, onButtonClick } = this.props
                            
                                const showMoreButton = resultCount > results.length
                            
                            
                            Severity: Minor
                            Found in client/app/Search/components/PaginatedSearchResults.jsx - 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

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

                            const mapStateToProps = function(state, ownProps) {
                            
                              const attrs = state.rform[ownProps.formId]
                              let value = ''
                              if (attrs && ownProps.submodel && attrs[ownProps.submodel]) {
                            Severity: Minor
                            Found in client/app/Inputs/containers/DateInput.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