ezeql/wiw-scheduler-api

View on GitHub
wiw/shift.go

Summary

Maintainability
A
50 mins
Test Coverage

Method Shift.UnmarshalJSON has 8 return statements (exceeds 4 allowed).
Open

func (s *Shift) UnmarshalJSON(b []byte) error {
    const rfc2822Layout = "Mon Jan 02 15:04:05 -0700 2006"
    var parsed map[string]interface{}

    if err := json.Unmarshal(b, &parsed); err != nil {
Severity: Major
Found in wiw/shift.go - About 50 mins to fix

    Your code does not pass gofmt in 3 places. Go fmt your code!
    Open

    package wiw
    Severity: Minor
    Found in wiw/shift.go by gofmt

    exported function SummarizeShifts should have comment or be unexported
    Open

    func SummarizeShifts(shifts []Shift) map[string][]float64 {
    Severity: Minor
    Found in wiw/shift.go by golint

    exported const WorkHoursPerDay should have comment or be unexported
    Open

    const WorkHoursPerDay = 8
    Severity: Minor
    Found in wiw/shift.go by golint

    exported type Shift should have comment or be unexported
    Open

    type Shift struct {
    Severity: Minor
    Found in wiw/shift.go by golint

    comment on exported method Shift.UnmarshalJSON should be of the form "UnmarshalJSON ..."
    Open

    //workaround since gorm wont recognize time.Time composed types
    Severity: Minor
    Found in wiw/shift.go by golint

    comment on exported const HoursPerWeek should be of the form "HoursPerWeek ..."
    Open

    //used for calculating hours worked in a whole week.
    Severity: Minor
    Found in wiw/shift.go by golint

    There are no issues that match your filters.

    Category
    Status