Fantom-foundation/go-lachesis

View on GitHub
inter/event_serializer.go

Summary

Maintainability
B
5 hrs
Test Coverage

Method EventHeaderData.UnmarshalBinary has 87 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (e *EventHeaderData) UnmarshalBinary(raw []byte) (err error) {
    defer func() {
        if r := recover(); r != nil {
            err = ErrInvalidEncoding
        }
Severity: Major
Found in inter/event_serializer.go - About 2 hrs to fix

    Method EventHeaderData.MarshalBinary has 73 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (e *EventHeaderData) MarshalBinary() ([]byte, error) {
        isPrevEpochHashEmpty := (e.PrevEpochHash == hash.Zero)
        isTxHashEmpty := (e.TxHash == EmptyTxHash)
    
        fields64 := []uint64{
    Severity: Minor
    Found in inter/event_serializer.go - About 1 hr to fix

      Method EventHeaderData.UnmarshalBinary has 5 return statements (exceeds 4 allowed).
      Open

      func (e *EventHeaderData) UnmarshalBinary(raw []byte) (err error) {
          defer func() {
              if r := recover(); r != nil {
                  err = ErrInvalidEncoding
              }
      Severity: Major
      Found in inter/event_serializer.go - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status