fzxiao233/Vtb_Record

View on GitHub
live/monitor/youtube/youtube.go

Summary

Maintainability
A
35 mins
Test Coverage

Method Youtube.getVideoInfo has 5 return statements (exceeds 4 allowed).
Open

func (y *Youtube) getVideoInfo(ctx *base.MonitorCtx, baseHost string, channelId string) error {
    url := baseHost + "/channel/" + channelId + "/live"
    htmlBody, err := ctx.HttpGet(url, map[string]string{})
    if err != nil {
        return err
Severity: Major
Found in live/monitor/youtube/youtube.go - About 35 mins to fix

    method parameter channelId should be channelID
    Open

    func (y *Youtube) getVideoInfo(ctx *base.MonitorCtx, baseHost string, channelId string) error {
    Severity: Minor
    Found in live/monitor/youtube/youtube.go by golint

    if block ends with a return statement, so drop this else and outdent its block
    Open

        } else {
    Severity: Minor
    Found in live/monitor/youtube/youtube.go by golint

    should not use dot imports
    Open

        . "github.com/fzxiao233/Vtb_Record/utils"
    Severity: Minor
    Found in live/monitor/youtube/youtube.go by golint

    exported method Youtube.CreateVideo should have comment or be unexported
    Open

    func (y *Youtube) CreateVideo(usersConfig config.UsersConfig) *interfaces.VideoInfo {
    Severity: Minor
    Found in live/monitor/youtube/youtube.go by golint

    exported type Youtube should have comment or be unexported
    Open

    type Youtube struct {
    Severity: Minor
    Found in live/monitor/youtube/youtube.go by golint

    exported method Youtube.CheckLive should have comment or be unexported
    Open

    func (y *Youtube) CheckLive(usersConfig config.UsersConfig) bool {
    Severity: Minor
    Found in live/monitor/youtube/youtube.go by golint

    There are no issues that match your filters.

    Category
    Status