solher/arangolite

View on GitHub
requests/statistics.go

Summary

Maintainability
A
35 mins
Test Coverage

Method GetStatisticsResult.UnmarshalJSON has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
Open

func (r *GetStatisticsResult) UnmarshalJSON(bytes []byte) (err error) {
    obj := make(map[string]interface{})
    err = json.Unmarshal(bytes, &obj)
    if err != nil {
        return err
Severity: Minor
Found in requests/statistics.go - About 35 mins to fix

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

exported method GetStatistics.Generate should have comment or be unexported
Open

func (r *GetStatistics) Generate() []byte {
Severity: Minor
Found in requests/statistics.go by golint

exported type DistributionStatistic should have comment or be unexported
Open

type DistributionStatistic struct {
Severity: Minor
Found in requests/statistics.go by golint

exported method GetStatisticsResult.UnmarshalJSON should have comment or be unexported
Open

func (r *GetStatisticsResult) UnmarshalJSON(bytes []byte) (err error) {
Severity: Minor
Found in requests/statistics.go by golint

exported type GetStatisticsResult should have comment or be unexported
Open

type GetStatisticsResult struct {
Severity: Minor
Found in requests/statistics.go by golint

exported method GetStatisticsDescription.Generate should have comment or be unexported
Open

func (r *GetStatisticsDescription) Generate() []byte {
Severity: Minor
Found in requests/statistics.go by golint

exported type StatisticsGroup should have comment or be unexported
Open

type StatisticsGroup struct {
Severity: Minor
Found in requests/statistics.go by golint

exported const StatisticsFigureTypeCurrent should have comment (or a comment on this block) or be unexported
Open

    StatisticsFigureTypeCurrent      StatisticsFigureType = "current"
Severity: Minor
Found in requests/statistics.go by golint

exported type StatisticsFigure should have comment or be unexported
Open

type StatisticsFigure struct {
Severity: Minor
Found in requests/statistics.go by golint

exported method GetStatistics.Path should have comment or be unexported
Open

func (r *GetStatistics) Path() string {
Severity: Minor
Found in requests/statistics.go by golint

exported type GetStatisticsDescriptionResult should have comment or be unexported
Open

type GetStatisticsDescriptionResult struct {
Severity: Minor
Found in requests/statistics.go by golint

exported method GetStatisticsDescription.Method should have comment or be unexported
Open

func (r *GetStatisticsDescription) Method() string {
Severity: Minor
Found in requests/statistics.go by golint

exported method GetStatistics.Method should have comment or be unexported
Open

func (r *GetStatistics) Method() string {
Severity: Minor
Found in requests/statistics.go by golint

exported method GetStatisticsDescription.Path should have comment or be unexported
Open

func (r *GetStatisticsDescription) Path() string {
Severity: Minor
Found in requests/statistics.go by golint

exported type StatisticsFigureType should have comment or be unexported
Open

type StatisticsFigureType string
Severity: Minor
Found in requests/statistics.go by golint

There are no issues that match your filters.

Category
Status