ReanGD/go-web-search

View on GitHub
crawler/response_parser.go

Summary

Maintainability
A
1 hr
Test Coverage

Method responseParser.processBody has 7 return statements (exceeds 4 allowed).
Open

func (r *responseParser) processBody(body []byte, contentType string) (database.State, error) {
    if !isHTML(body) {
        return database.StateParseError, werrors.New(ErrBodyNotHTML)
    }

Severity: Major
Found in crawler/response_parser.go - About 45 mins to fix

    Method responseParser.Run has 5 return statements (exceeds 4 allowed).
    Open

    func (r *responseParser) Run(response *http.Response) error {
        contentType, contentEncoding, err := r.processMeta(response.StatusCode, &response.Header)
        if err != nil {
            _ = response.Body.Close()
            return err
    Severity: Major
    Found in crawler/response_parser.go - About 35 mins to fix

      There are no issues that match your filters.

      Category
      Status