spec/lib/graphql_spec.rb

Summary

Maintainability
F
4 days
Test Coverage

File graphql_spec.rb has 517 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'rails_helper'

api_types  = GraphQL::ApiTypesCreator.create(API_TYPE_DEFINITIONS)
query_type = GraphQL::QueryTypeCreator.create(api_types)
ConsulSchema = GraphQL::Schema.define do
Severity: Major
Found in spec/lib/graphql_spec.rb - About 1 day to fix

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

        it 'only retruns tags with kind nil or category' do
          tag          = create(:tag, name: 'Parks')
          category_tag = create(:tag, :category, name: 'Health')
          admin_tag    = create(:tag, name: 'Admin tag', kind: 'admin')
    
    
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 1 other location - About 1 hr to fix
    spec/lib/graphql_spec.rb on lines 280..290

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

    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 'only retruns tags with kind nil or category' do
          tag          = create(:tag, name: 'Parks')
          category_tag = create(:tag, :category, name: 'Health')
          admin_tag    = create(:tag, name: 'Admin tag', kind: 'admin')
    
    
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 1 other location - About 1 hr to fix
    spec/lib/graphql_spec.rb on lines 208..218

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

    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 'does not include votes of comments from a hidden proposal' do
          visible_proposal = create(:proposal)
          hidden_proposal  = create(:proposal, :hidden)
    
          visible_proposal_comment = create(:comment, commentable: visible_proposal)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 1 other location - About 1 hr to fix
    spec/lib/graphql_spec.rb on lines 655..668

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

    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 'does not include votes of comments from a hidden debate' do
          visible_debate = create(:debate)
          hidden_debate  = create(:debate, :hidden)
    
          visible_debate_comment = create(:comment, commentable: visible_debate)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 1 other location - About 1 hr to fix
    spec/lib/graphql_spec.rb on lines 639..652

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

    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

        it 'displays comments of authors even if public activity is set to false' do
          visible_author = create(:user, public_activity: true)
          hidden_author  = create(:user, public_activity: false)
    
          visible_comment = create(:comment, user: visible_author)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 55 mins to fix
    spec/lib/graphql_spec.rb on lines 172..182
    spec/lib/graphql_spec.rb on lines 244..254

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

    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

        it 'includes debates of authors even if public activity is set to false' do
          visible_author = create(:user, public_activity: true)
          hidden_author  = create(:user, public_activity: false)
    
          visible_debate = create(:debate, author: visible_author)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 55 mins to fix
    spec/lib/graphql_spec.rb on lines 172..182
    spec/lib/graphql_spec.rb on lines 307..317

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

    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

        it 'includes proposals of authors even if public activity is set to false' do
          visible_author = create(:user, public_activity: true)
          hidden_author  = create(:user, public_activity: false)
    
          visible_proposal = create(:proposal, author: visible_author)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 55 mins to fix
    spec/lib/graphql_spec.rb on lines 244..254
    spec/lib/graphql_spec.rb on lines 307..317

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

    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

        it 'does not link author if public activity is set to false' do
          visible_author = create(:user, public_activity: true)
          hidden_author  = create(:user, public_activity: false)
    
          visible_comment = create(:comment, author: visible_author)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 50 mins to fix
    spec/lib/graphql_spec.rb on lines 185..195
    spec/lib/graphql_spec.rb on lines 257..267

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

    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

        it 'does not link author if public activity is set to false' do
          visible_author = create(:user, public_activity: true)
          hidden_author  = create(:user, public_activity: false)
    
          visible_proposal = create(:proposal, author: visible_author)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 50 mins to fix
    spec/lib/graphql_spec.rb on lines 257..267
    spec/lib/graphql_spec.rb on lines 320..330

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

    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

        it 'does not link author if public activity is set to false' do
          visible_author = create(:user, public_activity: true)
          hidden_author  = create(:user, public_activity: false)
    
          visible_debate = create(:debate, author: visible_author)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 50 mins to fix
    spec/lib/graphql_spec.rb on lines 185..195
    spec/lib/graphql_spec.rb on lines 320..330

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

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

        it 'does not include votes of hidden comments' do
          visible_comment = create(:comment)
          hidden_comment  = create(:comment, hidden_at: Time.current)
    
          visible_comment_vote = create(:vote, votable: visible_comment)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 45 mins to fix
    spec/lib/graphql_spec.rb on lines 343..353
    spec/lib/graphql_spec.rb on lines 356..366
    spec/lib/graphql_spec.rb on lines 369..379
    spec/lib/graphql_spec.rb on lines 613..623

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

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

        it 'does not include comments from hidden debates' do
          visible_debate = create(:debate)
          hidden_debate  = create(:debate, hidden_at: Time.current)
    
          visible_debate_comment = create(:comment, commentable: visible_debate)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 45 mins to fix
    spec/lib/graphql_spec.rb on lines 343..353
    spec/lib/graphql_spec.rb on lines 369..379
    spec/lib/graphql_spec.rb on lines 613..623
    spec/lib/graphql_spec.rb on lines 626..636

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

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

        it 'does not include comments from hidden polls' do
          visible_poll = create(:poll)
          hidden_poll  = create(:poll, hidden_at: Time.current)
    
          visible_poll_comment = create(:comment, commentable: visible_poll)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 45 mins to fix
    spec/lib/graphql_spec.rb on lines 343..353
    spec/lib/graphql_spec.rb on lines 356..366
    spec/lib/graphql_spec.rb on lines 613..623
    spec/lib/graphql_spec.rb on lines 626..636

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

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

        it 'does not include votes of hidden proposals' do
          visible_proposal = create(:proposal)
          hidden_proposal  = create(:proposal, hidden_at: Time.current)
    
          visible_proposal_vote = create(:vote, votable: visible_proposal)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 45 mins to fix
    spec/lib/graphql_spec.rb on lines 343..353
    spec/lib/graphql_spec.rb on lines 356..366
    spec/lib/graphql_spec.rb on lines 369..379
    spec/lib/graphql_spec.rb on lines 626..636

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

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

        it 'does not include comments from hidden proposals' do
          visible_proposal = create(:proposal)
          hidden_proposal  = create(:proposal, hidden_at: Time.current)
    
          visible_proposal_comment = create(:comment, commentable: visible_proposal)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 45 mins to fix
    spec/lib/graphql_spec.rb on lines 356..366
    spec/lib/graphql_spec.rb on lines 369..379
    spec/lib/graphql_spec.rb on lines 613..623
    spec/lib/graphql_spec.rb on lines 626..636

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

    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 'uppercase and lowercase tags work ok together for proposals' do
          create(:tag, name: 'Health')
          create(:tag, name: 'health')
          create(:proposal, tag_list: 'health')
          create(:proposal, tag_list: 'Health')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 1 other location - About 45 mins to fix
    spec/lib/graphql_spec.rb on lines 526..535

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

    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 'uppercase and lowercase tags work ok together for debates' do
          create(:tag, name: 'Health')
          create(:tag, name: 'health')
          create(:debate, tag_list: 'Health')
          create(:debate, tag_list: 'health')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 1 other location - About 45 mins to fix
    spec/lib/graphql_spec.rb on lines 514..523

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

    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

        it 'only links proposal if public' do
          visible_proposal = create(:proposal)
          hidden_proposal  = create(:proposal, :hidden)
    
          visible_proposal_notification = create(:proposal_notification, proposal: visible_proposal)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 40 mins to fix
    spec/lib/graphql_spec.rb on lines 449..459
    spec/lib/graphql_spec.rb on lines 600..610

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

    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

        it 'does not include votes from hidden debates' do
          visible_debate = create(:debate)
          hidden_debate  = create(:debate, :hidden)
    
          visible_debate_vote = create(:vote, votable: visible_debate)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 40 mins to fix
    spec/lib/graphql_spec.rb on lines 449..459
    spec/lib/graphql_spec.rb on lines 483..493

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

    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

        it 'does not include proposal notifications for hidden proposals' do
          visible_proposal = create(:proposal)
          hidden_proposal  = create(:proposal, :hidden)
    
          visible_proposal_notification = create(:proposal_notification, proposal: visible_proposal)
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 40 mins to fix
    spec/lib/graphql_spec.rb on lines 483..493
    spec/lib/graphql_spec.rb on lines 600..610

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

    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

        it 'does not include comments of proposals that are not public' do
          not_public_proposal = create(:proposal)
          not_public_proposal_comment = create(:comment, commentable: not_public_proposal)
          allow(Comment).to receive(:public_for_api).and_return([])
    
    
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 404..412
    spec/lib/graphql_spec.rb on lines 462..470

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

    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

        it 'does not include proposal notifications for proposals that are not public' do
          not_public_proposal = create(:proposal)
          not_public_proposal_notification = create(:proposal_notification, proposal: not_public_proposal)
          allow(ProposalNotification).to receive(:public_for_api).and_return([])
    
    
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 393..401
    spec/lib/graphql_spec.rb on lines 404..412

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

    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

        it 'does not include votes of debates that are not public' do
          not_public_debate = create(:debate)
          allow(Vote).to receive(:public_for_api).and_return([])
    
          not_public_debate_vote = create(:vote, votable: not_public_debate)
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 683..692
    spec/lib/graphql_spec.rb on lines 695..704

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

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

        it 'only returns date and hour for created_at' do
          created_at = Time.zone.parse("2017-12-31 9:30:15")
          create(:comment, created_at: created_at)
    
          response = execute('{ comments { edges { node { public_created_at } } } }')
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 198..205
    spec/lib/graphql_spec.rb on lines 270..277
    spec/lib/graphql_spec.rb on lines 473..480
    spec/lib/graphql_spec.rb on lines 707..714

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

    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

        it 'does not include votes of a hidden proposals' do
          not_public_proposal = create(:proposal)
          allow(Vote).to receive(:public_for_api).and_return([])
    
          not_public_proposal_vote = create(:vote, votable: not_public_proposal)
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 671..680
    spec/lib/graphql_spec.rb on lines 695..704

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

    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

        it 'does not include comments of polls that are not public' do
          not_public_poll = create(:poll)
          not_public_poll_comment = create(:comment, commentable: not_public_poll)
          allow(Comment).to receive(:public_for_api).and_return([])
    
    
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 393..401
    spec/lib/graphql_spec.rb on lines 462..470

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

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

        it 'only returns date and hour for created_at' do
          created_at = Time.zone.parse("2017-12-31 9:30:15")
          create(:debate, created_at: created_at)
    
          response = execute('{ debates { edges { node { public_created_at } } } }')
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 198..205
    spec/lib/graphql_spec.rb on lines 415..422
    spec/lib/graphql_spec.rb on lines 473..480
    spec/lib/graphql_spec.rb on lines 707..714

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

    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

        it 'does not include votes of a hidden comments' do
          not_public_comment = create(:comment)
          allow(Vote).to receive(:public_for_api).and_return([])
    
          not_public_comment_vote = create(:vote, votable: not_public_comment)
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 671..680
    spec/lib/graphql_spec.rb on lines 683..692

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

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

        it 'only returns date and hour for created_at' do
          created_at = Time.zone.parse("2017-12-31 9:30:15")
          create(:proposal, created_at: created_at)
    
          response = execute('{ proposals { edges { node { public_created_at } } } }')
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 270..277
    spec/lib/graphql_spec.rb on lines 415..422
    spec/lib/graphql_spec.rb on lines 473..480
    spec/lib/graphql_spec.rb on lines 707..714

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

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

        it 'only returns date and hour for created_at' do
          created_at = Time.zone.parse("2017-12-31 9:30:15")
          create(:proposal_notification, created_at: created_at)
    
          response = execute('{ proposal_notifications { edges { node { public_created_at } } } }')
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 198..205
    spec/lib/graphql_spec.rb on lines 270..277
    spec/lib/graphql_spec.rb on lines 415..422
    spec/lib/graphql_spec.rb on lines 707..714

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

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

        it 'only returns date and hour for created_at' do
          created_at = Time.zone.parse("2017-12-31 9:30:15")
          create(:vote, created_at: created_at)
    
          response = execute('{ votes { edges { node { public_created_at } } } }')
    Severity: Major
    Found in spec/lib/graphql_spec.rb and 4 other locations - About 35 mins to fix
    spec/lib/graphql_spec.rb on lines 198..205
    spec/lib/graphql_spec.rb on lines 270..277
    spec/lib/graphql_spec.rb on lines 415..422
    spec/lib/graphql_spec.rb on lines 473..480

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

    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 'does not include hidden proposals' do
          visible_proposal = create(:proposal)
          hidden_proposal  = create(:proposal, :hidden)
    
          response = execute('{ proposals { edges { node { title } } } }')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 1 other location - About 15 mins to fix
    spec/lib/graphql_spec.rb on lines 234..241

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

    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 'does not include hidden debates' do
          visible_debate = create(:debate)
          hidden_debate  = create(:debate, :hidden)
    
          response = execute('{ debates { edges { node { title } } } }')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 1 other location - About 15 mins to fix
    spec/lib/graphql_spec.rb on lines 150..157

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

    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

        it 'does not link proposals if activity is not public' do
          create(:proposal, author: user)
    
          response = execute("{ user(id: #{user.id}) { public_proposals { edges { node { title } } } } }")
          received_proposals = dig(response, 'data.user.public_proposals.edges')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 15 mins to fix
    spec/lib/graphql_spec.rb on lines 120..126
    spec/lib/graphql_spec.rb on lines 138..144

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

    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

        it 'does not link debates if activity is not public' do
          create(:debate, author: user)
    
          response = execute("{ user(id: #{user.id}) { public_debates { edges { node { title } } } } }")
          received_debates = dig(response, 'data.user.public_debates.edges')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 15 mins to fix
    spec/lib/graphql_spec.rb on lines 129..135
    spec/lib/graphql_spec.rb on lines 138..144

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

    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

        it 'does not link comments if activity is not public' do
          create(:comment, author: user)
    
          response = execute("{ user(id: #{user.id}) { public_comments { edges { node { body } } } } }")
          received_comments = dig(response, 'data.user.public_comments.edges')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb and 2 other locations - About 15 mins to fix
    spec/lib/graphql_spec.rb on lines 120..126
    spec/lib/graphql_spec.rb on lines 129..135

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

    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

    Line is too long. [115/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          response = execute("{ proposal(id: #{proposal.id}) { votes_for { edges { node { public_created_at } } } } }")
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    The first argument to describe should be the class or module being tested. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeClass)
    Open

    describe 'Consul Schema' do
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [104/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        expect(dig(response, 'data.proposal.public_author.username')).to eq(proposal.public_author.username)
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          not_public_proposal_notification = create(:proposal_notification, proposal: not_public_proposal)
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [106/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        response = execute("{ proposal(id: #{org_proposal.id}) { public_author { organization { name } } } }")
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [118/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          spending_proposal_comment = build(:comment, commentable: create(:spending_proposal)).save(skip_validation: true)
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [138/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          valid_proceeding_proposal = create(:proposal, proceeding: 'Derechos Humanos', sub_proceeding: 'Right to a Home', tag_list: 'Health')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [109/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        response = execute("{ proposals(first: 1) { edges { node { public_author { encrypted_password } } } } }")
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [129/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

      error_is_present = ((response['errors'].first['message'] =~ /Field '#{field_name}' doesn't exist on type '[[:alnum:]]*'/) == 0)
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          response = execute("{ user(id: #{user.id}) { public_proposals { edges { node { title } } } } }")
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    Line is too long. [118/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          human_rights_proposal = create(:proposal, proceeding: 'Derechos Humanos', sub_proceeding: 'Right to have a job')
    Severity: Minor
    Found in spec/lib/graphql_spec.rb by rubocop

    There are no issues that match your filters.

    Category
    Status