thrawn01/args

View on GitHub
parser_test.go

Summary

Maintainability
D
2 days
Test Coverage

File parser_test.go has 678 lines of code (exceeds 500 allowed). Consider refactoring.
Open

package args_test

import (
    "os"

Severity: Minor
Found in parser_test.go - About 6 hrs to fix

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

                parser.AddCommand("set", func(parent *args.ArgParser, data interface{}) (int, error) {
                    parent.AddArgument("first").Required()
                    _, err := parent.Parse(nil)
                    Expect(err).To(Not(BeNil()))
                    Expect(err.Error()).To(Equal("User asked for help; Inspect this error " +
    Severity: Major
    Found in parser_test.go and 1 other location - About 2 hrs to fix
    parser_test.go on lines 710..721

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

    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

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

                parser.AddCommand("set", func(parent *args.ArgParser, data interface{}) (int, error) {
                    parent.AddArgument("first").Required()
                    _, err := parent.Parse(nil)
                    Expect(err).To(Not(BeNil()))
                    Expect(err.Error()).To(Equal("User asked for help; Inspect this error " +
    Severity: Major
    Found in parser_test.go and 1 other location - About 2 hrs to fix
    parser_test.go on lines 683..694

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

    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 add a new group", func() {
                parser := args.NewParser()
                parser.AddOption("--power-level").Count()
                parser.InGroup("database").AddOption("--hostname")
                opt, err := parser.Parse(&cmdLine)
    Severity: Major
    Found in parser_test.go and 1 other location - About 1 hr to fix
    rule_modifier_test.go on lines 45..53

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

    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 allow multiple iterations of the same argument to create a map", func() {
                parser := args.NewParser()
                parser.AddOption("--map").IsStringMap()
    
                cmdLine := []string{"--map", "blue=bell", "--map", "cat=dog", "--map", "dad=boy"}
    Severity: Major
    Found in parser_test.go and 1 other location - About 1 hr to fix
    parser_test.go on lines 341..357

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

    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 allow multiple iterations of the same argument to create a map with JSON", func() {
                parser := args.NewParser()
                parser.AddOption("--map").IsStringMap()
    
                cmdLine := []string{
    Severity: Major
    Found in parser_test.go and 1 other location - About 1 hr to fix
    parser_test.go on lines 281..293

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

    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 error if apply on map is invalid type", func() {
                parser := args.NewParser()
                parser.AddOption("--list").IsStringSlice()
    
                options := parser.NewOptionsFromMap(
    Severity: Minor
    Found in parser_test.go and 1 other location - About 35 mins to fix
    parser_test.go on lines 308..318

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

    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 error if apply on map is invalid type", func() {
                parser := args.NewParser()
                parser.AddOption("--map").IsStringMap()
    
                options := parser.NewOptionsFromMap(
    Severity: Minor
    Found in parser_test.go and 1 other location - About 35 mins to fix
    parser_test.go on lines 192..202

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

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

            It("Should create argument rule first", func() {
                parser := args.NewParser()
                parser.AddArgument("first").IsString()
                rule := parser.GetRules()[0]
                Expect(rule.Name).To(Equal("first"))
    Severity: Major
    Found in parser_test.go and 5 other locations - About 35 mins to fix
    parser_test.go on lines 36..42
    parser_test.go on lines 43..49
    parser_test.go on lines 51..57
    parser_test.go on lines 59..65
    parser_test.go on lines 364..370

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

            It("Should create optional rule ++one", func() {
                parser := args.NewParser()
                parser.AddOption("++one").Count()
                rule := parser.GetRules()[0]
                Expect(rule.Name).To(Equal("one"))
    Severity: Major
    Found in parser_test.go and 5 other locations - About 35 mins to fix
    parser_test.go on lines 36..42
    parser_test.go on lines 51..57
    parser_test.go on lines 59..65
    parser_test.go on lines 364..370
    parser_test.go on lines 409..415

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

            It("Should create optional rule -one", func() {
                parser := args.NewParser()
                parser.AddOption("-one").Count()
                rule := parser.GetRules()[0]
                Expect(rule.Name).To(Equal("one"))
    Severity: Major
    Found in parser_test.go and 5 other locations - About 35 mins to fix
    parser_test.go on lines 36..42
    parser_test.go on lines 43..49
    parser_test.go on lines 59..65
    parser_test.go on lines 364..370
    parser_test.go on lines 409..415

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

            It("Should create optional rule --one", func() {
                parser := args.NewParser()
                parser.AddOption("--one").Count()
                rule := parser.GetRules()[0]
                Expect(rule.Name).To(Equal("one"))
    Severity: Major
    Found in parser_test.go and 5 other locations - About 35 mins to fix
    parser_test.go on lines 43..49
    parser_test.go on lines 51..57
    parser_test.go on lines 59..65
    parser_test.go on lines 364..370
    parser_test.go on lines 409..415

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

            It("Should create optional rule +one", func() {
                parser := args.NewParser()
                parser.AddOption("+one").Count()
                rule := parser.GetRules()[0]
                Expect(rule.Name).To(Equal("one"))
    Severity: Major
    Found in parser_test.go and 5 other locations - About 35 mins to fix
    parser_test.go on lines 36..42
    parser_test.go on lines 43..49
    parser_test.go on lines 51..57
    parser_test.go on lines 364..370
    parser_test.go on lines 409..415

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

            It("Should create argument rule first", func() {
                parser := args.NewParser()
                parser.AddPositional("first").IsString()
                rule := parser.GetRules()[0]
                Expect(rule.Name).To(Equal("first"))
    Severity: Major
    Found in parser_test.go and 5 other locations - About 35 mins to fix
    parser_test.go on lines 36..42
    parser_test.go on lines 43..49
    parser_test.go on lines 51..57
    parser_test.go on lines 59..65
    parser_test.go on lines 409..415

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

            It("Should match first argument 'one'", func() {
                parser := args.NewParser()
                parser.AddArgument("first").IsString()
                opt, err := parser.Parse(&cmdLine)
                Expect(err).To(BeNil())
    Severity: Major
    Found in parser_test.go and 6 other locations - About 35 mins to fix
    parser_test.go on lines 67..73
    parser_test.go on lines 74..80
    parser_test.go on lines 81..87
    parser_test.go on lines 88..94
    parser_test.go on lines 95..101
    parser_test.go on lines 371..377

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

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

            It("Should match -two", func() {
                parser := args.NewParser()
                parser.AddOption("-two").Count()
                opt, err := parser.Parse(&cmdLine)
                Expect(err).To(BeNil())
    Severity: Major
    Found in parser_test.go and 6 other locations - About 35 mins to fix
    parser_test.go on lines 67..73
    parser_test.go on lines 81..87
    parser_test.go on lines 88..94
    parser_test.go on lines 95..101
    parser_test.go on lines 371..377
    parser_test.go on lines 416..422

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

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

            It("Should match +four", func() {
                parser := args.NewParser()
                parser.AddOption("+four").Count()
                opt, err := parser.Parse(&cmdLine)
                Expect(err).To(BeNil())
    Severity: Major
    Found in parser_test.go and 6 other locations - About 35 mins to fix
    parser_test.go on lines 67..73
    parser_test.go on lines 74..80
    parser_test.go on lines 81..87
    parser_test.go on lines 95..101
    parser_test.go on lines 371..377
    parser_test.go on lines 416..422

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

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

            It("Should match --one", func() {
                parser := args.NewParser()
                parser.AddOption("--one").Count()
                opt, err := parser.Parse(&cmdLine)
                Expect(err).To(BeNil())
    Severity: Major
    Found in parser_test.go and 6 other locations - About 35 mins to fix
    parser_test.go on lines 74..80
    parser_test.go on lines 81..87
    parser_test.go on lines 88..94
    parser_test.go on lines 95..101
    parser_test.go on lines 371..377
    parser_test.go on lines 416..422

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

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

            It("Should match ++three", func() {
                parser := args.NewParser()
                parser.AddOption("++three").Count()
                opt, err := parser.Parse(&cmdLine)
                Expect(err).To(BeNil())
    Severity: Major
    Found in parser_test.go and 6 other locations - About 35 mins to fix
    parser_test.go on lines 67..73
    parser_test.go on lines 74..80
    parser_test.go on lines 88..94
    parser_test.go on lines 95..101
    parser_test.go on lines 371..377
    parser_test.go on lines 416..422

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

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

            It("Should match first argument 'one'", func() {
                parser := args.NewParser()
                parser.AddArgument("first").IsString()
                opt, err := parser.Parse(&cmdLine)
                Expect(err).To(BeNil())
    Severity: Major
    Found in parser_test.go and 6 other locations - About 35 mins to fix
    parser_test.go on lines 67..73
    parser_test.go on lines 74..80
    parser_test.go on lines 81..87
    parser_test.go on lines 88..94
    parser_test.go on lines 95..101
    parser_test.go on lines 416..422

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

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

            It("Should match --power-level", func() {
                parser := args.NewParser()
                parser.AddOption("--power-level").Count()
                opt, err := parser.Parse(&cmdLine)
                Expect(err).To(BeNil())
    Severity: Major
    Found in parser_test.go and 6 other locations - About 35 mins to fix
    parser_test.go on lines 67..73
    parser_test.go on lines 74..80
    parser_test.go on lines 81..87
    parser_test.go on lines 88..94
    parser_test.go on lines 371..377
    parser_test.go on lines 416..422

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

    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

    There are no issues that match your filters.

    Category
    Status