Preparing report...

Report for github.com/phoops/ngsiv2

A+    Excellent!    Found 4 issues across 6 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo66%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • ngsiv2/client/client.go
    • Line 563: warning: cyclomatic complexity 22 of function (*NgsiV2Client).ListEntities() is high (> 15) (gocyclo)
    • Line 648: warning: cyclomatic complexity 20 of function (*NgsiV2Client).CountEntities() is high (> 15) (gocyclo)

golint50%

Golint is a linter for Go source code.

    • ngsiv2/handler/notification_server_handler.go
    • Line 1: warning: package comment should be of the form "Package handler ..." (golint)
    • Line 32: warning: comment on exported method StatusError.Status should be of the form "Status ..." (golint)
    • Line 64: warning: exported function NewNgsiV2SubscriptionHandler should have comment or be unexported (golint)
    • Line 68: warning: exported function NgsiV2SubscriptionHandler should have comment or be unexported (golint)
    • Line 90: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • ngsiv2/model/model.go
    • Line 39: warning: exported type AttributeType should have comment or be unexported (golint)
    • Line 42: warning: exported const StringType should have comment (or a comment on this block) or be unexported (golint)
    • Line 58: warning: exported const DateCreatedAttributeName should have comment (or a comment on this block) or be unexported (golint)
    • Line 63: warning: exported type ActionType should have comment or be unexported (golint)
    • Line 66: warning: exported const AppendAction should have comment (or a comment on this block) or be unexported (golint)
    • Line 73: warning: exported type GeoPoint should have comment or be unexported (golint)
    • Line 78: warning: exported type APIResources should have comment or be unexported (golint)
    • Line 85: warning: exported type BatchUpdate should have comment or be unexported (golint)
    • Line 90: warning: exported type BatchQuery should have comment or be unexported (golint)
    • Line 97: warning: exported method BatchQuery.Match should have comment or be unexported (golint)
    • Line 114: warning: exported type EntityMatcher should have comment or be unexported (golint)
    • Line 121: warning: exported function NewEntityMatcher should have comment or be unexported (golint)
    • Line 125: warning: exported method EntityMatcher.ById should have comment or be unexported (golint)
    • Line 130: warning: exported method EntityMatcher.ByIdPattern should have comment or be unexported (golint)
    • Line 134: warning: exported method EntityMatcher.ByType should have comment or be unexported (golint)
    • Line 138: warning: exported method EntityMatcher.ByTypePattern should have comment or be unexported (golint)
    • Line 143: warning: exported type QueryExpression should have comment or be unexported (golint)
    • Line 151: warning: exported type SubscriptionSubjectEntity should have comment or be unexported (golint)
    • Line 153: warning: exported type SubscriptionSubjectConditionExpression should have comment or be unexported (golint)
    • Line 155: warning: exported type SubscriptionSubjectCondition should have comment or be unexported (golint)
    • Line 160: warning: exported type SubscriptionSubject should have comment or be unexported (golint)
    • Line 165: warning: exported type SubscriptionNotificationHttp should have comment or be unexported (golint)
    • Line 169: warning: exported type SubscriptionNotificationHttpCustom should have comment or be unexported (golint)
    • Line 177: warning: exported type SubscriptionNotification should have comment or be unexported (golint)
    • Line 191: warning: exported type Notification should have comment or be unexported (golint)
    • Line 196: warning: exported type OrionTime should have comment or be unexported (golint)
    • Line 200: warning: exported method OrionTime.MarshalJSON should have comment or be unexported (golint)
    • Line 209: warning: exported type Subscription should have comment or be unexported (golint)
    • Line 219: warning: exported type SubscriptionStatus should have comment or be unexported (golint)
    • Line 222: warning: exported const SubscriptionActive should have comment (or a comment on this block) or be unexported (golint)
    • Line 229: warning: exported const InvalidChars should have comment (or a comment on this block) or be unexported (golint)
    • Line 233: warning: exported var ReservedAttrNames should have comment or be unexported (golint)
    • Line 241: warning: exported const KeyValuesRepresentation should have comment (or a comment on this block) or be unexported (golint)
    • Line 247: warning: exported type SimpleLocationFormatGeometry should have comment or be unexported (golint)
    • Line 250: warning: exported const SLFPoint should have comment (or a comment on this block) or be unexported (golint)
    • Line 256: warning: exported type GeospatialRelationship should have comment or be unexported (golint)
    • Line 259: warning: exported const GeorelNear should have comment (or a comment on this block) or be unexported (golint)
    • Line 266: warning: exported type GeorelModifier should have comment or be unexported (golint)
    • Line 268: warning: exported function GeorelModifierMaxDistance should have comment or be unexported (golint)
    • Line 272: warning: exported function GeorelModifierMinDistance should have comment or be unexported (golint)
    • Line 276: warning: exported type SimpleQueryOperator should have comment or be unexported (golint)
    • Line 279: warning: exported const SQEqual should have comment (or a comment on this block) or be unexported (golint)
    • Line 288: warning: exported type SimpleQueryStatement should have comment or be unexported (golint)
    • Line 290: warning: exported function NewBinarySimpleQueryStatement should have comment or be unexported (golint)
    • Line 301: warning: exported function NewBinarySimpleQueryStatementMultipleValues should have comment or be unexported (golint)
    • Line 318: warning: exported function NewBinarySimpleQueryStatementRange should have comment or be unexported (golint)
    • Line 331: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 336: warning: comment on exported function NewEntity should be of the form "NewEntity ..." (golint)
    • Line 352: warning: exported method Entity.UnmarshalJSON should have comment or be unexported (golint)
    • Line 427: warning: exported method Entity.MarshalJSON should have comment or be unexported (golint)
    • Line 449: warning: exported function NewGeoPoint should have comment or be unexported (golint)
    • Line 453: warning: exported method GeoPoint.UnmarshalJSON should have comment or be unexported (golint)
    • Line 470: warning: exported method GeoPoint.MarshalJSON should have comment or be unexported (golint)
    • Line 474: warning: exported method Entity.GetAttribute should have comment or be unexported (golint)
    • Line 477: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 517: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 539: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 544: warning: exported method Entity.SetAttribute should have comment or be unexported (golint)
    • Line 557: warning: exported method Entity.SetAttributeAsString should have comment or be unexported (golint)
    • Line 570: warning: exported method Entity.SetAttributeAsText should have comment or be unexported (golint)
    • Line 583: warning: exported method Entity.SetAttributeAsNumber should have comment or be unexported (golint)
    • Line 596: warning: exported method Entity.SetAttributeAsInteger should have comment or be unexported (golint)
    • Line 609: warning: exported method Entity.SetAttributeAsFloat should have comment or be unexported (golint)
    • Line 622: warning: exported method Entity.SetAttributeAsBoolean should have comment or be unexported (golint)
    • Line 635: warning: exported method Entity.SetAttributeAsDateTime should have comment or be unexported (golint)
    • Line 648: warning: exported method Entity.SetDateExpires should have comment or be unexported (golint)
    • Line 657: warning: exported method Entity.SetAttributeAsGeoPoint should have comment or be unexported (golint)
    • Line 670: warning: exported method Entity.SetAttributeAsGeoJSON should have comment or be unexported (golint)
    • Line 683: warning: exported method Attribute.GetAsString should have comment or be unexported (golint)
    • Line 690: warning: exported method Attribute.GetAsInteger should have comment or be unexported (golint)
    • Line 697: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 703: warning: exported method Attribute.GetAsFloat should have comment or be unexported (golint)
    • Line 710: warning: exported method Attribute.GetAsBoolean should have comment or be unexported (golint)
    • Line 717: warning: exported method Attribute.GetAsDateTime should have comment or be unexported (golint)
    • Line 724: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 732: warning: exported method Attribute.GetAsGeoPoint should have comment or be unexported (golint)
    • Line 738: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 743: warning: exported method Attribute.GetAsGeoJSON should have comment or be unexported (golint)
    • Line 754: warning: exported method Entity.GetAttributeAsString should have comment or be unexported (golint)
    • Line 757: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 762: warning: exported method Entity.GetAttributeAsInteger should have comment or be unexported (golint)
    • Line 765: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 770: warning: exported method Entity.GetAttributeAsFloat should have comment or be unexported (golint)
    • Line 773: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 778: warning: exported method Entity.GetAttributeAsBoolean should have comment or be unexported (golint)
    • Line 781: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 786: warning: exported method Entity.GetAttributeAsDateTime should have comment or be unexported (golint)
    • Line 789: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 794: warning: exported method Entity.GetDateExpires should have comment or be unexported (golint)
    • Line 797: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 802: warning: exported method Entity.GetDateCreated should have comment or be unexported (golint)
    • Line 805: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 810: warning: exported method Entity.GetDateModified should have comment or be unexported (golint)
    • Line 813: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 818: warning: exported method Entity.GetAttributeAsGeoPoint should have comment or be unexported (golint)
    • Line 821: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 826: warning: exported method Entity.GetAttributeAsGeoJSON should have comment or be unexported (golint)
    • Line 834: warning: exported function NewBatchUpdate should have comment or be unexported (golint)
    • Line 839: warning: exported method BatchUpdate.AddEntity should have comment or be unexported (golint)
    • ngsiv2/client/client.go
    • Line 19: warning: exported type NgsiV2Client should have comment or be unexported (golint)
    • Line 100: warning: exported method NgsiV2Client.BatchUpdate should have comment or be unexported (golint)
    • Line 122: warning: exported method NgsiV2Client.BatchQuery should have comment or be unexported (golint)
    • Line 183: warning: exported type BatchQueryParamFunc should have comment or be unexported (golint)
    • Line 185: warning: exported function BatchQuerySetLimit should have comment or be unexported (golint)
    • Line 195: warning: exported function BatchQuerySetOffset should have comment or be unexported (golint)
    • Line 205: warning: exported function BatchQueryAddOrderBy should have comment or be unexported (golint)
    • Line 220: warning: exported function BatchQuerySetOptions should have comment or be unexported (golint)
    • Line 241: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 245: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 295: warning: exported type RetrieveEntityParamFunc should have comment or be unexported (golint)
    • Line 305: warning: exported function RetrieveEntitySetType should have comment or be unexported (golint)
    • Line 319: warning: exported function RetrieveEntityAddAttribute should have comment or be unexported (golint)
    • Line 328: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 333: warning: exported function RetrieveEntitySetOptions should have comment or be unexported (golint)
    • Line 339: warning: exported function RetrieveEntitySetFiwareService should have comment or be unexported (golint)
    • Line 346: warning: exported function RetrieveEntitySetFiwareServicePath should have comment or be unexported (golint)
    • Line 403: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 407: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 425: warning: exported type ListEntitiesParamFunc should have comment or be unexported (golint)
    • Line 427: warning: exported function ListEntitiesSetId should have comment or be unexported (golint)
    • Line 438: warning: exported function ListEntitiesSetIds should have comment or be unexported (golint)
    • Line 451: warning: exported function ListEntitiesSetIdPattern should have comment or be unexported (golint)
    • Line 461: warning: exported function ListEntitiesSetType should have comment or be unexported (golint)
    • Line 467: warning: exported function ListEntitiesAddAttribute should have comment or be unexported (golint)
    • Line 473: warning: exported function ListEntitiesSetOptions should have comment or be unexported (golint)
    • Line 479: warning: exported function ListEntitiesSetLimit should have comment or be unexported (golint)
    • Line 489: warning: exported function ListEntitiesSetOffset should have comment or be unexported (golint)
    • Line 499: warning: exported function ListEntitiesAddOrderBy should have comment or be unexported (golint)
    • Line 514: warning: exported function ListEntitiesAddCoord should have comment or be unexported (golint)
    • Line 521: warning: exported function ListEntitiesSetGeometry should have comment or be unexported (golint)
    • Line 528: warning: exported function ListEntitiesSetGeoRel should have comment or be unexported (golint)
    • Line 540: warning: exported function ListEntitiesAddQueryStatement should have comment or be unexported (golint)
    • Line 547: warning: exported function ListEntitiesSetFiwareService should have comment or be unexported (golint)
    • Line 554: warning: exported function ListEntitiesSetFiwareServicePath should have comment or be unexported (golint)
    • Line 637: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 641: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 744: warning: exported type CreateEntityParamFunc should have comment or be unexported (golint)
    • Line 746: warning: exported function CreateEntitySetOptionsUpsert should have comment or be unexported (golint)
    • Line 753: warning: exported function CreateEntitySetOptionsKeyValues should have comment or be unexported (golint)
    • Line 760: warning: exported function CreateEntitySetFiwareService should have comment or be unexported (golint)
    • Line 767: warning: exported function CreateEntitySetFiwareServicePath should have comment or be unexported (golint)
    • Line 834: warning: exported type SubscriptionParamFunc should have comment or be unexported (golint)
    • Line 836: warning: exported function SubscriptionSetFiwareService should have comment or be unexported (golint)
    • Line 843: warning: exported function SubscriptionSetFiwareServicePath should have comment or be unexported (golint)
    • Line 912: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 916: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 929: warning: exported type RetrieveSubscriptionsParamFunc should have comment or be unexported (golint)
    • Line 931: warning: exported function RetrieveSubscriptionsSetLimit should have comment or be unexported (golint)
    • Line 941: warning: exported function RetrieveSubscriptionsSetOffset should have comment or be unexported (golint)
    • Line 951: warning: exported function RetrieveSubscriptionsSetOptions should have comment or be unexported (golint)
    • Line 961: warning: exported function RetrieveSubscriptionsSetFiwareService should have comment or be unexported (golint)
    • Line 968: warning: exported function RetrieveSubscriptionsSetFiwareServicePath should have comment or be unexported (golint)
    • Line 975: warning: exported type SubscriptionsResponse should have comment or be unexported (golint)
    • Line 1020: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 1024: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!