kujenga/goml

View on GitHub

Showing 3 of 5 total issues

Function Read has 55 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func Read(rootDir string) (*MNIST, error) {
    trainRawImages, err := idx.ReadFile(
        filepath.Join(rootDir, "train-images-idx3-ubyte.gz"))
    if err != nil {
        return nil, err
Severity: Minor
Found in mnist/mnist.go - About 1 hr to fix

    Function Read has 7 return statements (exceeds 4 allowed).
    Open

    func Read(rdr io.Reader) (*IDX, error) {
        // Read in the "magic number" which provides us with information about
        // the format of the data in this IDX file.
        magic := make([]byte, 4)
        n, err := rdr.Read(magic)
    Severity: Major
    Found in idx/idx.go - About 45 mins to fix

      Function Read has 5 return statements (exceeds 4 allowed).
      Open

      func Read(rootDir string) (*MNIST, error) {
          trainRawImages, err := idx.ReadFile(
              filepath.Join(rootDir, "train-images-idx3-ubyte.gz"))
          if err != nil {
              return nil, err
      Severity: Major
      Found in mnist/mnist.go - About 35 mins to fix
        Severity
        Category
        Status
        Source
        Language