wfleming/go-timecard

View on GitHub

Showing 8 of 8 total issues

Function printSummariesCsv has a Cognitive Complexity of 32 (exceeds 20 allowed). Consider refactoring.
Open

func printSummariesCsv(summaries []timecard.DaySummary) {
var allProjects = make([]string, 0)
 
indexStr := func(arr []string, needle string) int {
for idx, str := range arr {
Severity: Minor
Found in punch/summary_command.go - About 2 hrs to fix

Function printSummariesCsv has 52 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func printSummariesCsv(summaries []timecard.DaySummary) {
var allProjects = make([]string, 0)
 
indexStr := func(arr []string, needle string) int {
for idx, str := range arr {
Severity: Minor
Found in punch/summary_command.go - About 1 hr to fix

    Method Log.PunchOut has 6 return statements (exceeds 4 allowed).
    Open

    func (log *Log) PunchOut(timeOut time.Time) error {
    lastEntry, err := log.LastEntry()
    if err != nil {
    return err
    } else if lastEntry == nil || lastEntry.IsZero() {
    Severity: Major
    Found in timecard/log.go - About 40 mins to fix

      Method Log.PunchIn has 5 return statements (exceeds 4 allowed).
      Open

      func (log *Log) PunchIn(timeIn time.Time, projectName string) error {
      lastEntry, err := log.LastEntry()
      if err != nil {
      return err
      } else if lastEntry != nil && lastEntry.TimeOut.IsZero() {
      Severity: Major
      Found in timecard/log.go - About 35 mins to fix

        comment on exported method Entry.Duration should be of the form "Duration ..."
        Open

        // An Entry's Duration is the difference between its TimeOut & TimeIn.
        Severity: Minor
        Found in timecard/entry.go by golint

        package comment should be of the form "Package timecard ..."
        Open

        // Functions for dealing with a punchcard-log formatted stream (file, pipe)
        Severity: Minor
        Found in timecard/log.go by golint

        comment on exported method Entry.IsZero should be of the form "IsZero ..."
        Open

        // An Entry is consider zero if each of it's 3 members is also zero.
        Severity: Minor
        Found in timecard/entry.go by golint

        comment on exported method Log.AllEntries should be of the form "AllEntries ..."
        Open

        // Returns an array of all entries contained in the log.
        Severity: Minor
        Found in timecard/log.go by golint
        Severity
        Category
        Status
        Source
        Language