Unleash/unleash-client-go

View on GitHub
api/feature.go

Summary

Maintainability
A
40 mins
Test Coverage
C
71%

Function getSeed has 6 return statements (exceeds 4 allowed).
Open

func getSeed(ctx *context.Context, stickiness string) string {
    if stickiness != "default" && stickiness != "" {
        value := ctx.Field(stickiness)
        if value == "" {
            return strconv.Itoa(rand.Intn(10000))
Severity: Major
Found in api/feature.go - About 40 mins to fix

    2: cannot find package "github.com/Unleash/unleash-client-go/v3/context" in any of:
    Open

        "github.com/Unleash/unleash-client-go/v3/context"
    Severity: Minor
    Found in api/feature.go by govet

    exported method FeatureResponse.FeatureMap should have comment or be unexported
    Open

    func (fr FeatureResponse) FeatureMap() map[string]interface{} {
    Severity: Minor
    Found in api/feature.go by golint

    exported type FeatureResponse should have comment or be unexported
    Open

    type FeatureResponse struct {
    Severity: Minor
    Found in api/feature.go by golint

    exported method FeatureResponse.SegmentsMap should have comment or be unexported
    Open

    func (fr FeatureResponse) SegmentsMap() map[int][]Constraint {
    Severity: Minor
    Found in api/feature.go by golint

    func parameter groupId should be groupID
    Open

    func getNormalizedNumber(identifier, groupId string, normalizer int) uint32 {
    Severity: Minor
    Found in api/feature.go by golint

    exported type Segment should have comment or be unexported
    Open

    type Segment struct {
    Severity: Minor
    Found in api/feature.go by golint

    exported type Feature should have comment or be unexported
    Open

    type Feature struct {
    Severity: Minor
    Found in api/feature.go by golint

    struct field Id should be ID
    Open

        Id          int          `json:"id"`
    Severity: Minor
    Found in api/feature.go by golint

    exported type Dependency should have comment or be unexported
    Open

    type Dependency struct {
    Severity: Minor
    Found in api/feature.go by golint

    comment on exported method VariantCollection.GetVariant should be of the form "GetVariant ..."
    Open

    // Get variant for a given feature which is considered as enabled
    Severity: Minor
    Found in api/feature.go by golint

    exported type ParameterMap should have comment or be unexported
    Open

    type ParameterMap map[string]interface{}
    Severity: Minor
    Found in api/feature.go by golint

    There are no issues that match your filters.

    Category
    Status