initiatived21/d21

View on GitHub

Showing 611 of 611 total issues

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

describe('askedQuestions reducer', function() {
  it('should return the initial state', function() {
    reducer(undefined, {}).should.eql([])
  })

Severity: Major
Found in client/app/lib/reducers/askedQuestions_test.js and 2 other locations - About 5 hrs to fix
client/app/lib/reducers/signedPledges_test.js on lines 4..21
client/app/lib/reducers/submittedUpdates_test.js on lines 4..21

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 148.

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 3 locations. Consider refactoring.
Open

describe('signedPledges reducer', function() {
  it('should return the initial state', function() {
    reducer(undefined, {}).should.eql([])
  })

Severity: Major
Found in client/app/lib/reducers/signedPledges_test.js and 2 other locations - About 5 hrs to fix
client/app/lib/reducers/askedQuestions_test.js on lines 4..21
client/app/lib/reducers/submittedUpdates_test.js on lines 4..21

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 148.

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 137 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const {
      onLinkClick, userLoggedIn, form, afterResponse, formId
    } = this.props

Severity: Major
Found in client/app/NewPledge/components/PledgeForm.jsx - About 5 hrs to fix

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

    export default class GoogleplusButton extends ChildComponent {
      render() {
        const { url, handleClick } = this.props
    
        return (
    client/app/SocialMediaButtons/components/FacebookButton.jsx on lines 5..22
    client/app/SocialMediaButtons/components/LinkedinButton.jsx on lines 5..22
    client/app/SocialMediaButtons/components/XingButton.jsx on lines 5..22

    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 127.

    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 4 locations. Consider refactoring.
    Open

    export default class XingButton extends ChildComponent {
      render() {
        const { url, handleClick } = this.props
    
        return (
    Severity: Major
    Found in client/app/SocialMediaButtons/components/XingButton.jsx and 3 other locations - About 4 hrs to fix
    client/app/SocialMediaButtons/components/FacebookButton.jsx on lines 5..22
    client/app/SocialMediaButtons/components/GoogleplusButton.jsx on lines 5..22
    client/app/SocialMediaButtons/components/LinkedinButton.jsx on lines 5..22

    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 127.

    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 4 locations. Consider refactoring.
    Open

    export default class LinkedinButton extends ChildComponent {
      render() {
        const { url, handleClick } = this.props
    
        return (
    Severity: Major
    Found in client/app/SocialMediaButtons/components/LinkedinButton.jsx and 3 other locations - About 4 hrs to fix
    client/app/SocialMediaButtons/components/FacebookButton.jsx on lines 5..22
    client/app/SocialMediaButtons/components/GoogleplusButton.jsx on lines 5..22
    client/app/SocialMediaButtons/components/XingButton.jsx on lines 5..22

    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 127.

    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 4 locations. Consider refactoring.
    Open

    export default class FacebookButton extends ChildComponent {
      render() {
        const { url, handleClick } = this.props
    
        return (
    Severity: Major
    Found in client/app/SocialMediaButtons/components/FacebookButton.jsx and 3 other locations - About 4 hrs to fix
    client/app/SocialMediaButtons/components/GoogleplusButton.jsx on lines 5..22
    client/app/SocialMediaButtons/components/LinkedinButton.jsx on lines 5..22
    client/app/SocialMediaButtons/components/XingButton.jsx on lines 5..22

    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 127.

    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

    Method has too many lines. [32/10]
    Open

      def show
        @pledge = Pledge.includes(:initiator).find(params[:id])
    
        authorize @pledge
    
    

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Block has too many lines. [71/25]
    Open

    ActiveAdmin.register Pledge do
      permit_params :content, :amount, :who, :requirement, :location, :deadline,
                    :description, :title, :image, :recommended, :locale
    
      Pledge.aasm.events.each do |aasm_event|
    Severity: Minor
    Found in app/admin/pledge.rb by rubocop

    This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

    const mergeProps = function(stateProps, dispatchProps, ownProps) {
      const { id } = ownProps
      const { dispatch } = dispatchProps
    
      return {
    Severity: Major
    Found in client/app/Sidebar/containers/SignPledgeFormContainer.js and 1 other location - About 3 hrs to fix
    client/app/Sidebar/containers/UpdateFormContainer.js on lines 20..36

    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 111.

    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

    const mergeProps = function(stateProps, dispatchProps, ownProps) {
      const { id } = ownProps
      const { dispatch } = dispatchProps
    
      return {
    Severity: Major
    Found in client/app/Sidebar/containers/UpdateFormContainer.js and 1 other location - About 3 hrs to fix
    client/app/Sidebar/containers/SignPledgeFormContainer.js on lines 18..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 111.

    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 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const {
          model, attribute, submodel, errors, value, min, max,
          noLabel, inlineLabel, formId, className
        } = this.props
    Severity: Major
    Found in client/app/Inputs/components/NumberInputComponent.jsx - About 3 hrs to fix

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

      export default class PledgeAnswer extends ChildComponent {
        static propTypes = {
          children: PropTypes.string.isRequired
        }
      
      
      Severity: Major
      Found in client/app/CommentList/components/PledgeAnswer.jsx and 1 other location - About 3 hrs to fix
      client/app/CommentList/components/PledgeQuestion.jsx on lines 5..20

      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 106.

      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

      export default class PledgeQuestion extends ChildComponent {
        static propTypes = {
          children: PropTypes.string.isRequired
        }
      
      
      Severity: Major
      Found in client/app/CommentList/components/PledgeQuestion.jsx and 1 other location - About 3 hrs to fix
      client/app/CommentList/components/PledgeAnswer.jsx on lines 5..20

      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 106.

      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

      Assignment Branch Condition size for show is too high. [31.06/15]
      Open

        def show
          @pledge = Pledge.includes(:initiator).find(params[:id])
      
          authorize @pledge
      
      

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

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

        it('should render an SVG if image path is not provided', function () {
          const wrapper = mount(<Avatar {...props} imagePath={null} />)
          const svg = wrapper.find('svg')
      
          svg.length.should.equal(1)
      Severity: Major
      Found in client/app/Avatar/components/Avatar_test.js and 1 other location - About 3 hrs to fix
      client/app/Avatar/components/CommentAvatar_test.js on lines 20..26

      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 104.

      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

        it('should render an SVG if image path is not provided', function () {
          const wrapper = mount(<CommentAvatar {...props} imagePath={null} />)
          const svg = wrapper.find('svg')
      
          svg.length.should.equal(1)
      Severity: Major
      Found in client/app/Avatar/components/CommentAvatar_test.js and 1 other location - About 3 hrs to fix
      client/app/Avatar/components/Avatar_test.js on lines 20..26

      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 104.

      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

      describe('<PledgeQuestion />', function () {
        it('should render', function () {
          const wrapper = shallow(<PledgeQuestion>Um welche Laptops handelt es sich?</PledgeQuestion>)
      
          wrapper.find(CommentAvatar).length.should.equal(1)
      Severity: Major
      Found in client/app/CommentList/components/PledgeQuestion_test.js and 1 other location - About 3 hrs to fix
      client/app/CommentList/components/PledgeAnswer_test.js on lines 7..14

      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 102.

      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

      describe('<PledgeAnswer />', function () {
        it('should render', function () {
          const wrapper = shallow(<PledgeAnswer>Es sind Lenovo-Laptops.</PledgeAnswer>)
      
          wrapper.find(CommentAvatar).length.should.equal(1)
      Severity: Major
      Found in client/app/CommentList/components/PledgeAnswer_test.js and 1 other location - About 3 hrs to fix
      client/app/CommentList/components/PledgeQuestion_test.js on lines 7..14

      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 102.

      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 70 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { asSubmodel, labelContent } = this.props
      
          return(
            <div>
      Severity: Major
      Found in client/app/UserForm/components/UserForm.jsx - About 2 hrs to fix
        Severity
        Category
        Status
        Source
        Language