api/hostmanagement/openamt/openamt.go
Method Service.DeviceInformation
has 57 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (service *Service) DeviceInformation(configuration portainer.OpenAMTConfiguration, deviceGUID string) (*portainer.OpenAMTDeviceInformation, error) {
token, err := service.Authorization(configuration)
if err != nil {
return nil, err
}
Method Service.DeviceInformation
has 10 return statements (exceeds 4 allowed). Open
Open
func (service *Service) DeviceInformation(configuration portainer.OpenAMTConfiguration, deviceGUID string) (*portainer.OpenAMTDeviceInformation, error) {
token, err := service.Authorization(configuration)
if err != nil {
return nil, err
}
Method Service.executeGetRequest
has 7 return statements (exceeds 4 allowed). Open
Open
func (service *Service) executeGetRequest(url string, token string) ([]byte, error) {
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return nil, err
}
Method Service.executeSaveRequest
has 6 return statements (exceeds 4 allowed). Open
Open
func (service *Service) executeSaveRequest(method string, url string, token string, payload []byte) ([]byte, error) {
req, err := http.NewRequest(method, url, bytes.NewBuffer(payload))
if err != nil {
return nil, err
}