Skip to content

To reduce the if complexity, please change to: #82

@sbp-bvanb

Description

@sbp-bvanb
          To reduce the if complexity, please change to:
if !endpoint.EndpointID.Path == ei.Path || !endpoint.EndpointID.HTTPMethod == ei.HTTPMethod {
  log.Info("some message") // if needed
  continue
}

currentScore := calculateMatch(&endpoint, ei)
			if _, exists := endpointsScoring[currentScore]; exists {
				return nil, fmt.Errorf("can't match for request: %s, to many matches", GetID(&endpoint.EndpointID))
			}
			endpointsScoring[currentScore] = &endpoint
			if currentScore > maxScore {
				maxScore = currentScore
			}

Originally posted by @sbp-bvanb in #81 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions