Showing 98 of 159 total issues
Function DirRemoveAllChildren
has 6 return statements (exceeds 4 allowed). Open
Open
func DirRemoveAllChildren(dir string) error {
isDir, err := IsDir(dir)
if err != nil {
return err
}
Function CopyFile
has 6 return statements (exceeds 4 allowed). Open
Open
func CopyFile(src, dst string) error {
r, err := os.Open(src)
if err != nil {
return err
}
Function AnyStringToQuarterTime
has 6 return statements (exceeds 4 allowed). Open
Open
func AnyStringToQuarterTime(yyyyqSrcStr string) time.Time {
yyyyqSrcStr = strings.TrimSpace(yyyyqSrcStr)
// If not a string, return now time.
if len(yyyyqSrcStr) != 5 {
return time.Now().UTC()
Method SliceInt.BuildStats
has 6 return statements (exceeds 4 allowed). Open
Open
func (sint *SliceInt) BuildStats() (SliceIntStats, error) {
stats := NewSliceIntStats()
stats.Len = sint.Len()
max, err := sint.Max()
if err != nil {
Function AddFileToArchive
has 6 return statements (exceeds 4 allowed). Open
Open
func AddFileToArchive(tw *tar.Writer, filename, archivename string) error {
// Open the file which will be written into the archive
file, err := os.Open(filename)
if err != nil {
return err
Function ToBool
has 6 return statements (exceeds 4 allowed). Open
Open
func ToBool(v any) bool {
if v == nil {
return false
} else if valBool, ok := v.(bool); ok {
return valBool
Function Dd6ToTime
has 6 return statements (exceeds 4 allowed). Open
Open
func Dd6ToTime(dd6 string, reverse bool) (time.Time, error) {
dd6 = strings.ToLower(strings.TrimSpace(dd6))
yyyy := ""
mm36 := ""
dd36 := ""
Function GetWriteFile
has 6 return statements (exceeds 4 allowed). Open
Open
func GetWriteFile(client *http.Client, url, filename string) (*http.Response, error) {
if client == nil {
client = &http.Client{}
}
resp, err := client.Get(url)
Method SliceFloat64.BuildStats
has 6 return statements (exceeds 4 allowed). Open
Open
func (sf64 *SliceFloat64) BuildStats() (SliceFloat64Stats, error) {
stats := NewSliceFloat64Stats()
stats.Len = sf64.Len()
max, err := sf64.Max()
if err != nil {
Consider simplifying this complex logical expression. Open
Open
if t.Before(tr.Min) || t.After(tr.Max) ||
(!inclusiveMin && t.Equal(tr.Min)) ||
(!inclusiveMax && t.Equal(tr.Max)) {
Function VisitFiles
has 6 return statements (exceeds 4 allowed). Open
Open
func VisitFiles(name string, visitFunc func(dir string, info fs.FileInfo) error) error {
fileInfo, err := os.Stat(name)
if err != nil {
return err
}
Function DT6sToString
has 6 return statements (exceeds 4 allowed). Open
Open
func DT6sToString(startDT6, endDT6 int32, layout, presentText, prefixText, joinText, suffixText string) (string, error) {
if startDT6 <= 0 && endDT6 <= 0 {
return "", nil
}
startText, endText, err := DT6sToStrings(startDT6, endDT6, layout, presentText)
Consider simplifying this complex logical expression. Open
Open
if !(inclExists && inclNotExists) &&
((!inclExists && exists) || (!inclNotExists && !exists)) {
Function GetRSAPublicKeyForPKCS8PublicKeyPath
has 6 return statements (exceeds 4 allowed). Open
Open
func GetRSAPublicKeyForPKCS8PublicKeyPath(pubKeyPkcs8Path string) (*rsa.PublicKey, error) {
var pubKey *rsa.PublicKey
isFile, err := osutil.IsFile(pubKeyPkcs8Path, true)
if err != nil {
Function AddFileToZip
has 6 return statements (exceeds 4 allowed). Open
Open
func AddFileToZip(zipWriter *zip.Writer, filename string, removePaths bool) error {
fileToZip, err := os.Open(filename)
if err != nil {
return err
}
Function ValidAlphabets
has 6 return statements (exceeds 4 allowed). Open
Open
func ValidAlphabets(a1, a2 string, a2optional bool) error {
if a1 == "" {
return errors.New("alphabet 1 cannot be empty")
} else if !stringsutil.UniqueRunes(a1) {
return errors.New("alphabet 1 chars are not unique")
Function ParseEndpoint
has 6 return statements (exceeds 4 allowed). Open
Open
func ParseEndpoint(s string) (*Endpoint, error) {
parts := strings.Fields(s)
if len(parts) == 0 {
return nil, errors.New("empty string cannot be parsed as RUL")
} else if len(parts) == 1 {
Function AbsFilepath
has 6 return statements (exceeds 4 allowed). Open
Open
func AbsFilepath(path string) (string, error) {
path = strings.TrimSpace(path)
if len(path) == 0 {
return path, nil
} else if filepath.IsAbs(path) {
Function LogOrNot
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func LogOrNot(ctx context.Context, logger *slog.Logger, level slog.Level, msg string, attrs ...slog.Attr) {
Function JoinInterface
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func JoinInterface(arr []any, sep string, stripRepeatedSep bool, stripEmbeddedSep bool, altSep string) string {