vorteil/vorteil

View on GitHub
pkg/qcow2/qcow2.go

Summary

Maintainability
A
1 hr
Test Coverage

Method Writer.init has 6 return statements (exceeds 4 allowed).
Open

func (w *Writer) init() error {

    w.clusterSize = 0x10000
    w.sectorsPerCluster = w.clusterSize / SectorSize

Severity: Major
Found in pkg/qcow2/qcow2.go - About 40 mins to fix

    Method Writer.writeL1Table has 5 return statements (exceeds 4 allowed).
    Open

    func (w *Writer) writeL1Table() error {
    
        l2Capacity := w.clusterSize * (w.clusterSize / 8)
    
        buf := new(bytes.Buffer)
    Severity: Major
    Found in pkg/qcow2/qcow2.go - About 35 mins to fix

      TODO found
      Open

              L1Size:                uint32(w.l2Blocks), // TODO: should this be divided by 8? (bytes per entry)
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by fixme

      TODO found
      Open

          // TODO: check not writing into a forbidden cluster
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by fixme

      exported type HolePredictor should have comment or be unexported
      Open

      type HolePredictor interface {
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by golint

      exported type Header should have comment or be unexported
      Open

      type Header struct {
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by golint

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

          SectorSize = 0x200
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by golint

      exported type Writer should have comment or be unexported
      Open

      type Writer struct {
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by golint

      exported method Writer.Seek should have comment or be unexported
      Open

      func (w *Writer) Seek(offset int64, whence int) (int64, error) {
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by golint

      exported function NewWriter should have comment or be unexported
      Open

      func NewWriter(w io.WriteSeeker, h HolePredictor) (*Writer, error) {
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by golint

      exported method Writer.Close should have comment or be unexported
      Open

      func (w *Writer) Close() error {
      Severity: Minor
      Found in pkg/qcow2/qcow2.go by golint

      There are no issues that match your filters.

      Category
      Status