Colors
has 23 methods (exceeds 20 allowed). Consider refactoring.
type Colors struct{}
Similar blocks of code found in 2 locations. Consider refactoring.
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))
Similar blocks of code found in 2 locations. Consider refactoring.
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))
Similar blocks of code found in 2 locations. Consider refactoring.
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)
Similar blocks of code found in 2 locations. Consider refactoring.
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)
Similar blocks of code found in 5 locations. Consider refactoring.
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")
Similar blocks of code found in 5 locations. Consider refactoring.
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")
Similar blocks of code found in 5 locations. Consider refactoring.
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")
Similar blocks of code found in 5 locations. Consider refactoring.
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")
Similar blocks of code found in 5 locations. Consider refactoring.
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")
Method Command.IsValid
has 5 return statements (exceeds 4 allowed).
func (command *Command) IsValid() error {
application := command.config.Application
if len(application) == 0 {
return errors.New("no application was specified")
}
Method FileInitialiser.Handle
has 5 return statements (exceeds 4 allowed).
func (fi FileInitialiser) Handle(skip ...bool) error {
if len(skip) > 0 && skip[0] {
fi.logger.Info(
Color("gray",
fmt.Sprintf("godev> skipping '%s' - already exists", path.Base(fi.Path)),
Similar blocks of code found in 4 locations. Consider refactoring.
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))
}
Similar blocks of code found in 4 locations. Consider refactoring.
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))
}
Similar blocks of code found in 4 locations. Consider refactoring.
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))
}
Similar blocks of code found in 4 locations. Consider refactoring.
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))
}
Your code does not pass gofmt in 1 place. Go fmt your code!
2: cannot find package "github.com/urfave/cli" in any of:
"github.com/urfave/cli"