V8033. Two similar code fragments were found. A second fragment may contain a typo.
V8033 Two similar code fragments were found. The second fragment may contain a typo: the "option.Height" variable should be used instead of the "option.Width". captcha.go 48
if option.Width == 0 {
option.Width = 240
}
if option.Height == 0 {
option.Width = 80
}
if option.Length == 0 {
option.Length = 6
}
if option.Lang == "" {
option.Lang = "zh"
}
V8033 Two similar code fragments were found. The second fragment may contain a typo: the "h.DeltaCRLExpiryPercentage" variable should be used instead of the "h.CRLExpiryPercentage". pki_crl_validity_period.go 195
for name, crl := range h.CRLs {
....
ratio := time.Duration(
(int64(total) * int64(h.CRLExpiryPercentage)) / int64(100)
)
if used >= ratio {
expWhen := crl.ThisUpdate.Add(ratio)
ret.Status = ResultCritical
ret.Message = fmt.Sprintf(
....,
crl.NextUpdate.Format("2006-01-02"),
h.CRLExpiryPercentage,
crl.ThisUpdate.Format("2006-01-02"),
expWhen.Format("2006-01-02")
)
....
}
results = append(results, &ret)
}
for name, crl := range h.DeltaCRLs {
....
ratio := time.Duration(
(int64(total) * int64(h.DeltaCRLExpiryPercentage)) / int64(100)
)
if used >= ratio {
expWhen := crl.ThisUpdate.Add(ratio)
ret.Status = ResultCritical
ret.Message = fmt.Sprintf(
....,
crl.NextUpdate.Format("2006-01-02"),
h.CRLExpiryPercentage,
crl.ThisUpdate.Format("2006-01-02"),
expWhen.Format("2006-01-02")
)
....
}
results = append(results, &ret)
}
V8033 Two similar code fragments were found. The second fragment may contain a typo: the "itr" variable should be used instead of the "it". service.go 476
usersKey := model.GroupUserPath(groupID, "")
it, err := kv.NewSecondaryIterator(....)
if err != nil {
return err
}
defer it.Close()
for it.Next() {
entry := it.Entry()
user := entry.Value.(*model.UserData)
....
}
if err = it.Err(); err != nil {
return err
}
policiesKey := model.GroupPolicyPath(groupID, "")
itr, err := kv.NewSecondaryIterator(....)
if err != nil {
return err
}
defer it.Close()
for itr.Next() {
entry := itr.Entry()
policy := entry.Value.(*model.PolicyData)
....
}
if err = itr.Err(); err != nil {
return err
}
V8033 Two similar code fragments were found. The second fragment may contain a typo: the "filter.excludeIds" variable should be used instead of the "filter.block". tag_filter.go 434
for _, tag := range config.ExcludeTags {
for _, val := range splitCommaTrim(tag) {
if _, ok := filter.block[val]; !ok {
filter.block[val] = struct{}{}
}
}
}
for _, tag := range config.Severities {
if _, ok := filter.severities[tag]; !ok {
filter.severities[tag] = struct{}{}
}
}
....
for _, tag := range config.ExcludeProtocols {
if _, ok := filter.excludeTypes[tag]; !ok {
filter.excludeTypes[tag] = struct{}{}
}
}
for _, id := range config.ExcludeIds {
for _, val := range splitCommaTrim(id) {
if _, ok := filter.block[val]; !ok {
filter.excludeIds[val] = struct{}{}
}
}
}
V8033 Two similar code fragments were found. The second fragment may contain a typo: the "st" variable should be used instead of the "sb". ast.go 233
if goOptMapAlias[sb.Scope.GetOptions().GetGoPackage()] != "" {
reqName = goOptMapAlias[sb.Scope.GetOptions().GetGoPackage()] +
"." + inputGoType.GoIdent.GoName
}
if goOptMapAlias[sb.Scope.GetOptions().GetGoPackage()] != "" {
respName = goOptMapAlias[st.Scope.GetOptions().GetGoPackage()] +
"." + outputGoType.GoIdent.GoName
}
V8033 Two similar code fragments were found. The second fragment may contain a typo: the "cfg.Basic.DataPath" variable should be used instead of the "cfg.Basic.WasmPluginPath". conf_mod_wasmplugin.go 63
if cfg.Basic.WasmPluginPath == "" {
....
cfg.Basic.WasmPluginPath = "mod_wasm"
}
cfg.Basic.WasmPluginPath = bfe_util.ConfPathProc(....)
if cfg.Basic.DataPath == "" {
....
cfg.Basic.WasmPluginPath = "mod_wasm/wasm.data"
}
cfg.Basic.DataPath = bfe_util.ConfPathProc(cfg.Basic.DataPath,
confRoot)
V8033 Two similar code fragments were found. The second fragment may contain a typo: the "conf.GraylogFieldCDSServiceType" variable should be used instead of the "conf.GraylogFieldCDSServiceName". log.go 107
if conf.GraylogFieldCDSServiceName != "" {
extra["CDSName"] = conf.GraylogFieldCDSServiceName
}
if conf.GraylogFieldCDSServiceName != "" {
extra["CDSService"] = conf.GraylogFieldCDSServiceType
}
if conf.GraylogFieldCDSVersion != "" {
extra["CDSVersion"] = conf.GraylogFieldCDSVersion
}
if conf.GraylogFieldCDSOS != "" {
extra["CDSOS"] = conf.GraylogFieldCDSOS
}
if conf.GraylogFieldCDSArch != "" {
extra["CDSArch"] = conf.GraylogFieldCDSArch
}