requests/statistics.go
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
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 type StatisticsFigure should have comment or be unexported Open
Open
type StatisticsFigure struct {
- Exclude checks
exported type GetStatisticsResult should have comment or be unexported Open
Open
type GetStatisticsResult struct {
- Exclude checks
exported type GetStatisticsDescriptionResult should have comment or be unexported Open
Open
type GetStatisticsDescriptionResult struct {
- Exclude checks
exported method GetStatistics.Path should have comment or be unexported Open
Open
func (r *GetStatistics) Path() string {
- Exclude checks
exported type StatisticsFigureType should have comment or be unexported Open
Open
type StatisticsFigureType string
- Exclude checks
exported type DistributionStatistic should have comment or be unexported Open
Open
type DistributionStatistic struct {
- Exclude checks
exported method GetStatisticsDescription.Generate should have comment or be unexported Open
Open
func (r *GetStatisticsDescription) Generate() []byte {
- Exclude checks
exported method GetStatisticsDescription.Method should have comment or be unexported Open
Open
func (r *GetStatisticsDescription) Method() string {
- Exclude checks
exported method GetStatistics.Method should have comment or be unexported Open
Open
func (r *GetStatistics) Method() string {
- Exclude checks
exported type StatisticsGroup should have comment or be unexported Open
Open
type StatisticsGroup struct {
- Exclude checks
exported method GetStatisticsDescription.Path should have comment or be unexported Open
Open
func (r *GetStatisticsDescription) Path() string {
- Exclude checks
exported const StatisticsFigureTypeCurrent should have comment (or a comment on this block) or be unexported Open
Open
StatisticsFigureTypeCurrent StatisticsFigureType = "current"
- Exclude checks