core/main.go
Method AutoSpotting.handleNewOnDemandInstanceLaunch
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (a *AutoSpotting) handleNewOnDemandInstanceLaunch(r *region, i *instance) error {
var spotInstanceID *string
var err error
if !i.shouldBeReplacedWithSpot() {
Method AutoSpotting.handleLifecycleHookEvent
has 9 return statements (exceeds 4 allowed). Open
Open
func (a *AutoSpotting) handleLifecycleHookEvent(event events.CloudWatchEvent) error {
var ctEvent CloudTrailEvent
// Try to parse the event.Detail as Cloudwatch Event Rule
if err := json.Unmarshal(event.Detail, &ctEvent); err != nil {
Method AutoSpotting.handleNewOnDemandInstanceLaunch
has 8 return statements (exceeds 4 allowed). Open
Open
func (a *AutoSpotting) handleNewOnDemandInstanceLaunch(r *region, i *instance) error {
var spotInstanceID *string
var err error
if !i.shouldBeReplacedWithSpot() {
Method AutoSpotting.handleNewInstanceLaunch
has 7 return statements (exceeds 4 allowed). Open
Open
func (a *AutoSpotting) handleNewInstanceLaunch(regionName string, instanceID string, state string) error {
r := ®ion{name: regionName, conf: a.config, services: connections{}}
if !r.enabled() {
return fmt.Errorf("region %s is not enabled", regionName)