MacroPower/wakatime_exporter

View on GitHub

Showing 3 of 5 total issues

Method summaryCollector.Update has 82 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (c *summaryCollector) Update(ch chan<- prometheus.Metric) error {
    params := url.Values{}
    params.Add("start", "today")
    params.Add("end", "today")
    params.Add("cache", "false")
Severity: Major
Found in collector/summary.go - About 2 hrs to fix

    Function main has 75 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func main() {
        var (
            disableDefaultCollectors = kingpin.Flag(
                "collector.disable-defaults",
                "Set all collectors to disabled by default.",
    Severity: Minor
    Found in main.go - About 2 hrs to fix

      Method goalCollector.Update has 55 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (c *goalCollector) Update(ch chan<- prometheus.Metric) error {
          params := url.Values{}
          params.Add("cache", "false")
      
          body, fetchErr := c.fetchStat(c.uri, goalEndpoint, params)
      Severity: Minor
      Found in collector/goal.go - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language