Function ListMatch
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring.
func ListMatch(root string, flag int, patterns ...string) (entries []*FilePathInfo, err error) {
var (
rePatterns []*regexp.Regexp
typeFlag = flag & ListIncludeAll
useRegExp = flag&ListUseRegExp != 0
Function copyDir
has a Cognitive Complexity of 28 (exceeds 20 allowed). Consider refactoring.
func copyDir(src, dest string) (err error) {
var srcInfo, destInfo os.FileInfo
if srcInfo, err = os.Stat(src); err == nil {
Function bufferCopyFile
has 57 lines of code (exceeds 50 allowed). Consider refactoring.
func bufferCopyFile(src, dest string, bufferSize int64) (err error) {
var (
srcFile, destFile *os.File
srcInfo, destInfo os.FileInfo
)
Function bufferCopyFile
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
func bufferCopyFile(src, dest string, bufferSize int64) (err error) {
var (
srcFile, destFile *os.File
srcInfo, destInfo os.FileInfo
)
Function SameDirEntries
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
func SameDirEntries(path1, path2 string) (same bool, err error) {
var (
fi1, fi2 os.FileInfo
raw1, raw2 = path1, path2
items1, items2 []*FilePathInfo
Function SameDirEntries
has 7 return statements (exceeds 4 allowed).
func SameDirEntries(path1, path2 string) (same bool, err error) {
var (
fi1, fi2 os.FileInfo
raw1, raw2 = path1, path2
items1, items2 []*FilePathInfo
Function SameFileContent
has 6 return statements (exceeds 4 allowed).
func SameFileContent(path1, path2 string) (same bool, err error) {
if path1, path2, err = refineComparePaths(path1, path2); err != nil {
return
}
Function moveEntry
has 5 arguments (exceeds 4 allowed). Consider refactoring.
func moveEntry(src, dest string, check funcCheckFileInfo, errMode error, remove funcRemoveEntry, copy funcCopyEntry) (err error) {