jkawamoto/loci

View on GitHub

Showing 61 of 61 total issues

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

func TestPythonArgumentSetWithFullDescriptions(t *testing.T) {

    travis, err := storeAndLoadTravis(&Travis{
        Language: "python",
        Python:   []string{"2.7", "3.5"},
Severity: Major
Found in command/travis_python_test.go and 1 other location - About 1 day to fix
command/travis_go_test.go on lines 279..325

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

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

func TestGoArgumentSetWithFullDescriptions(t *testing.T) {

    travis, err := storeAndLoadTravis(&Travis{
        Language: "go",
        Go:       []string{"1.6", "1.7"},
Severity: Major
Found in command/travis_go_test.go and 1 other location - About 1 day to fix
command/travis_python_test.go on lines 256..302

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function run has a Cognitive Complexity of 74 (exceeds 20 allowed). Consider refactoring.
Open

func run(opt *RunOpt) (err error) {

    // Prepare to be canceled.
    ctx, cancel := context.WithCancel(context.Background())
    defer cancel()
Severity: Minor
Found in command/run.go - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

func TestGoMatrixExclude(t *testing.T) {

    var err error
    travis, err := NewTravis([]byte(`language: "go"
go:
Severity: Major
Found in command/travis_go_test.go and 1 other location - About 7 hrs to fix
command/travis_python_test.go on lines 69..123

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

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

func TestPythonMatrixExclude(t *testing.T) {

    var err error
    travis, err := NewTravis([]byte(`language: "python"
python:
Severity: Major
Found in command/travis_python_test.go and 1 other location - About 7 hrs to fix
command/travis_go_test.go on lines 71..127

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function run has 193 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func run(opt *RunOpt) (err error) {

    // Prepare to be canceled.
    ctx, cancel := context.WithCancel(context.Background())
    defer cancel()
Severity: Major
Found in command/run.go - About 6 hrs to fix

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

    func TestPythonMatrixInclude(t *testing.T) {
    
        var err error
        travis, err := storeAndLoadTravis(&Travis{
            Language: "python",
    Severity: Major
    Found in command/travis_python_test.go and 1 other location - About 6 hrs to fix
    command/travis_go_test.go on lines 23..69

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

    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

    func TestGoMatrixInclude(t *testing.T) {
    
        var err error
        travis, err := storeAndLoadTravis(&Travis{
            Language: "go",
    Severity: Major
    Found in command/travis_go_test.go and 1 other location - About 6 hrs to fix
    command/travis_python_test.go on lines 23..67

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function TestGoArgumentSet has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
    Open

    func TestGoArgumentSet(t *testing.T) {
    
        var (
            travis *Travis
            res    TestCaseSet
    Severity: Minor
    Found in command/travis_go_test.go - About 5 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    func TestEntrypointPython(t *testing.T) {
    
        travis := Travis{
            Language:      "python",
            BeforeInstall: []string{"binstall_1", "binstall_2"},
    Severity: Major
    Found in command/entrypoint_test.go and 1 other location - About 5 hrs to fix
    command/entrypoint_test.go on lines 54..87

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

    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

    func TestEntrypointGo(t *testing.T) {
    
        travis := Travis{
            Language:      "go",
            BeforeInstall: []string{"binstall_1", "binstall_2"},
    Severity: Major
    Found in command/entrypoint_test.go and 1 other location - About 5 hrs to fix
    command/entrypoint_test.go on lines 19..52

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function TestPythonArgumentSet has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring.
    Open

    func TestPythonArgumentSet(t *testing.T) {
    
        var (
            travis *Travis
            res    TestCaseSet
    Severity: Minor
    Found in command/travis_python_test.go - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function TestGoArgumentSet has 140 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func TestGoArgumentSet(t *testing.T) {
    
        var (
            travis *Travis
            res    TestCaseSet
    Severity: Major
    Found in command/travis_go_test.go - About 4 hrs to fix

      Function TestPythonArgumentSet has 120 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func TestPythonArgumentSet(t *testing.T) {
      
          var (
              travis *Travis
              res    TestCaseSet
      Severity: Major
      Found in command/travis_python_test.go - About 3 hrs to fix

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

        func TestParseEnvWithSpecificGlobals(t *testing.T) {
        
            globals := []string{
                "DB=postgres",
                "SH=bash",
        Severity: Major
        Found in command/travis_test.go and 1 other location - About 2 hrs to fix
        command/travis_test.go on lines 271..300

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

        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

        func TestParseEnvWithGlobalsList(t *testing.T) {
        
            globals := []string{
                "DB=postgres",
                "SH=bash",
        Severity: Major
        Found in command/travis_test.go and 1 other location - About 2 hrs to fix
        command/travis_test.go on lines 332..362

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

        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

        func TestParseEnvWithMultipleVariablesList(t *testing.T) {
        
            matrix := []string{
                "FOO=foo BAR=bar",
                "FOO=bar BAR=foo",
        Severity: Major
        Found in command/travis_test.go and 1 other location - About 2 hrs to fix
        command/travis_test.go on lines 364..392

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

        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

        func TestParseEnvWithSpecificMatrixVariables(t *testing.T) {
        
            matrix := []string{
                "FOO=foo BAR=bar",
                "FOO=bar BAR=foo",
        Severity: Major
        Found in command/travis_test.go and 1 other location - About 2 hrs to fix
        command/travis_test.go on lines 302..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 213.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function TestPythonOverwriteEvnSet has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
        Open

        func TestPythonOverwriteEvnSet(t *testing.T) {
        
            var err error
            // The following configuration is copied from matplotlib.
            travis, err := NewTravis([]byte(`language: "python"
        Severity: Minor
        Found in command/travis_python_test.go - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function run has 19 return statements (exceeds 4 allowed).
        Open

        func run(opt *RunOpt) (err error) {
        
            // Prepare to be canceled.
            ctx, cancel := context.WithCancel(context.Background())
            defer cancel()
        Severity: Major
        Found in command/run.go - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language