zephinzer/godev

View on GitHub

Showing 13 of 18 total issues

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

func (s *GitInitialiserTestSuite) TestConfirm() {
    reader := bufio.NewReader(strings.NewReader("y\n"))
    assert.True(s.T(), s.gitInitialiser.Confirm(reader))
    reader = bufio.NewReader(strings.NewReader("n\n"))
    assert.False(s.T(), s.gitInitialiser.Confirm(reader))
Severity: Minor
Found in initialiser.git_test.go and 1 other location - About 50 mins to fix
initialiser.file_test.go on lines 58..63

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

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 (s *FileInitialiserTestSuite) TestConfirm() {
    reader := bufio.NewReader(strings.NewReader("y\n"))
    assert.True(s.T(), s.fileInitialiser.Confirm(reader))
    reader = bufio.NewReader(strings.NewReader("n\n"))
    assert.False(s.T(), s.fileInitialiser.Confirm(reader))
Severity: Minor
Found in initialiser.file_test.go and 1 other location - About 50 mins to fix
initialiser.git_test.go on lines 68..73

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

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 (s *WatcherTestSuite) Test_pathIsDirectory() {
    w := &Watcher{}
    cwd := s.currentDirectory
    assert.Truef(s.T(), w.pathIsDirectory(cwd), "expected '%s' (current working directory) to be a directory but it was not", cwd)

Severity: Minor
Found in watcher_test.go and 1 other location - About 40 mins to fix
watcher_test.go on lines 168..175

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

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 (s *WatcherTestSuite) Test_pathExists() {
    w := &Watcher{}
    cwd := s.currentDirectory
    assert.Truef(s.T(), w.pathExists(cwd), "expected '%s' (current working directory) to exist but it did not", cwd)

Severity: Minor
Found in watcher_test.go and 1 other location - About 40 mins to fix
watcher_test.go on lines 177..184

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

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

func (s *LoggerTestSuite) TestInfo() {
    s.logger.Info("Info")
    s.logger.Infof("%s", "ofnI")
    assert.Contains(s.T(), s.logs.String(), "Info")
    assert.Contains(s.T(), s.logs.String(), "ofnI")
Severity: Major
Found in logger_test.go and 4 other locations - About 40 mins to fix
logger_test.go on lines 48..53
logger_test.go on lines 55..60
logger_test.go on lines 69..74
logger_test.go on lines 76..81

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

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

func (s *LoggerTestSuite) TestDebug() {
    s.logger.Debug("Debug")
    s.logger.Debugf("%s", "gubeD")
    assert.Contains(s.T(), s.logs.String(), "Debug")
    assert.Contains(s.T(), s.logs.String(), "gubeD")
Severity: Major
Found in logger_test.go and 4 other locations - About 40 mins to fix
logger_test.go on lines 48..53
logger_test.go on lines 62..67
logger_test.go on lines 69..74
logger_test.go on lines 76..81

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

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

func (s *LoggerTestSuite) TestTrace() {
    s.logger.Trace("Trace")
    s.logger.Tracef("%s", "ecarT")
    assert.Contains(s.T(), s.logs.String(), "Trace")
    assert.Contains(s.T(), s.logs.String(), "ecarT")
Severity: Major
Found in logger_test.go and 4 other locations - About 40 mins to fix
logger_test.go on lines 55..60
logger_test.go on lines 62..67
logger_test.go on lines 69..74
logger_test.go on lines 76..81

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

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

func (s *LoggerTestSuite) TestError() {
    s.logger.Error("Error")
    s.logger.Errorf("%s", "rorrE")
    assert.Contains(s.T(), s.logs.String(), "Error")
    assert.Contains(s.T(), s.logs.String(), "rorrE")
Severity: Major
Found in logger_test.go and 4 other locations - About 40 mins to fix
logger_test.go on lines 48..53
logger_test.go on lines 55..60
logger_test.go on lines 62..67
logger_test.go on lines 69..74

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

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

func (s *LoggerTestSuite) TestWarn() {
    s.logger.Warn("Warn")
    s.logger.Warnf("%s", "nraW")
    assert.Contains(s.T(), s.logs.String(), "Warn")
    assert.Contains(s.T(), s.logs.String(), "nraW")
Severity: Major
Found in logger_test.go and 4 other locations - About 40 mins to fix
logger_test.go on lines 48..53
logger_test.go on lines 55..60
logger_test.go on lines 62..67
logger_test.go on lines 76..81

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

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

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

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

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

Refactorings

Further Reading

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

func (s *UtilsTestSuite) Test_confirm_withoutReply() {
    assert.True(s.T(), confirm(bufio.NewReader(strings.NewReader("\n")), "hi", true))
    assert.False(s.T(), confirm(bufio.NewReader(strings.NewReader("\n")), "hi", false))
}
Severity: Major
Found in utils_test.go and 3 other locations - About 30 mins to fix
utils_test.go on lines 47..50
utils_test.go on lines 52..55
utils_test.go on lines 57..60

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

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

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

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

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

Refactorings

Further Reading

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

func (s *UtilsTestSuite) Test_confirm_withWindowsReply() {
    assert.True(s.T(), confirm(bufio.NewReader(strings.NewReader("y\r\n")), "hi", true))
    assert.False(s.T(), confirm(bufio.NewReader(strings.NewReader("n\r\n")), "hi", true))
}
Severity: Major
Found in utils_test.go and 3 other locations - About 30 mins to fix
utils_test.go on lines 47..50
utils_test.go on lines 57..60
utils_test.go on lines 67..70

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

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

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

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

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

Refactorings

Further Reading

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

func (s *UtilsTestSuite) Test_confirm_withWeirdReplyNoRetry() {
    assert.False(s.T(), confirm(bufio.NewReader(strings.NewReader("something\n")), "hi", true))
    assert.False(s.T(), confirm(bufio.NewReader(strings.NewReader("something\n")), "hi", true))
}
Severity: Major
Found in utils_test.go and 3 other locations - About 30 mins to fix
utils_test.go on lines 47..50
utils_test.go on lines 52..55
utils_test.go on lines 67..70

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

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

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

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

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

Refactorings

Further Reading

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

func (s *UtilsTestSuite) Test_confirm_withReply() {
    assert.True(s.T(), confirm(bufio.NewReader(strings.NewReader("y\n")), "hi", true))
    assert.False(s.T(), confirm(bufio.NewReader(strings.NewReader("n\n")), "hi", true))
}
Severity: Major
Found in utils_test.go and 3 other locations - About 30 mins to fix
utils_test.go on lines 52..55
utils_test.go on lines 57..60
utils_test.go on lines 67..70

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

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

Severity
Category
Status
Source
Language