Showing 101 of 101 total issues
Method Database.Run
has 6 return statements (exceeds 4 allowed). Open
Open
func (db *Database) Run(ctx context.Context, v interface{}, q Runnable) error {
if q == nil {
return nil
}
Method Database.Send
has 6 return statements (exceeds 4 allowed). Open
Open
func (db *Database) Send(ctx context.Context, q Runnable) (Response, error) {
if q == nil {
return &response{}, nil
}
Method GetStatisticsResult.UnmarshalJSON
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
Open
func (r *GetStatisticsResult) UnmarshalJSON(bytes []byte) (err error) {
obj := make(map[string]interface{})
err = json.Unmarshal(bytes, &obj)
if err != nil {
return err
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method basicSender.Send
has 5 return statements (exceeds 4 allowed). Open
Open
func (s *basicSender) Send(ctx context.Context, cli *http.Client, req *http.Request) (*response, error) {
select {
case <-ctx.Done():
return nil, ctx.Err()
default:
Your code does not pass gofmt in 2 places. Go fmt your code! Open
Open
package requests
- Exclude checks
exported method DropCollection.Method should have comment or be unexported Open
Open
func (r *DropCollection) Method() string {
- Exclude checks
exported method TruncateCollection.Generate should have comment or be unexported Open
Open
func (r *TruncateCollection) Generate() []byte {
- Exclude checks
exported method GetStatistics.Generate should have comment or be unexported Open
Open
func (r *GetStatistics) Generate() []byte {
- Exclude checks
exported method GetStatisticsResult.UnmarshalJSON should have comment or be unexported Open
Open
func (r *GetStatisticsResult) UnmarshalJSON(bytes []byte) (err error) {
- Exclude checks
exported method CreateAQLFunction.Generate should have comment or be unexported Open
Open
func (r *CreateAQLFunction) Generate() []byte {
- Exclude checks
exported method SetCacheProperties.Generate should have comment or be unexported Open
Open
func (r *SetCacheProperties) Generate() []byte {
- Exclude checks
exported method CreateCollection.Path should have comment or be unexported Open
Open
func (r *CreateCollection) Path() string {
- Exclude checks
exported method TruncateCollection.Method should have comment or be unexported Open
Open
func (r *TruncateCollection) Method() string {
- Exclude checks
exported method ListCollections.Path should have comment or be unexported Open
Open
func (c *ListCollections) Path() string {
- Exclude checks
exported method CreateGraph.Path should have comment or be unexported Open
Open
func (c *CreateGraph) Path() string {
- Exclude checks
exported method GetGraph.Method should have comment or be unexported Open
Open
func (g *GetGraph) Method() string {
- Exclude checks
exported type StatisticsFigure should have comment or be unexported Open
Open
type StatisticsFigure struct {
- Exclude checks
exported method GetAQLFunctions.Generate should have comment or be unexported Open
Open
func (r *GetAQLFunctions) Generate() []byte {
- Exclude checks
exported method AQL.Method should have comment or be unexported Open
Open
func (a *AQL) Method() string {
- Exclude checks
exported type GetAQLFunctionsResult should have comment or be unexported Open
Open
type GetAQLFunctionsResult []AQLFunction
- Exclude checks