hussar-lang/hussar

View on GitHub
parser/parser.go

Summary

Maintainability
B
4 hrs
Test Coverage

Parser has 34 methods (exceeds 20 allowed). Consider refactoring.
Open

type Parser struct {
    l      *lexer.Lexer
    errors []string

    curToken  token.Token
Severity: Minor
Found in parser/parser.go - About 4 hrs to fix

    Method Parser.parseIfExpression has 5 return statements (exceeds 4 allowed).
    Open

    func (p *Parser) parseIfExpression() ast.Expression {
        expression := &ast.IfExpression{Token: p.curToken}
    
        if !p.expectPeek(token.LPAREN) {
            // error
    Severity: Major
    Found in parser/parser.go - About 35 mins to fix

      exported type Parser should have comment or be unexported
      Open

      type Parser struct {
      Severity: Minor
      Found in parser/parser.go by golint

      exported method Parser.ParseProgram should have comment or be unexported
      Open

      func (p *Parser) ParseProgram() *ast.Program {
      Severity: Minor
      Found in parser/parser.go by golint

      exported const TRACE should have comment or be unexported
      Open

      const TRACE = false
      Severity: Minor
      Found in parser/parser.go by golint

      exported const LOWEST should have comment (or a comment on this block) or be unexported
      Open

          LOWEST
      Severity: Minor
      Found in parser/parser.go by golint

      exported function New should have comment or be unexported
      Open

      func New(l *lexer.Lexer) *Parser {
      Severity: Minor
      Found in parser/parser.go by golint

      exported method Parser.Errors should have comment or be unexported
      Open

      func (p *Parser) Errors() []string {
      Severity: Minor
      Found in parser/parser.go by golint

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

          } else {
      Severity: Minor
      Found in parser/parser.go by golint

      There are no issues that match your filters.

      Category
      Status