Preparing report...

Report for github.com/AchoArnold/cracking-the-coding-interview

A+    Excellent!    Found 48 issues across 245 files

Tweet

gofmt99%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo99%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.


golint83%

Golint is a linter for Go source code.

    • cracking-the-coding-interview/chapter4/graph.go
    • Line 3: warning: exported type Graph should have comment or be unexported (golint)
    • Line 7: warning: exported type GraphNode should have comment or be unexported (golint)
    • Line 12: warning: exported function StringToInterfaceSlice should have comment or be unexported (golint)
    • Line 21: warning: exported function IntToInterfaceSlice should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter3/1_multi_stack_array.go
    • Line 8: warning: comment on exported type MultiArrayStack should be of the form "MultiArrayStack ..." (with optional leading article) (golint)
    • Line 18: warning: exported function NewMultiArrayStack should have comment or be unexported (golint)
    • Line 27: warning: exported method MultiArrayStack.Pop should have comment or be unexported (golint)
    • Line 31: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 39: warning: exported method MultiArrayStack.Push should have comment or be unexported (golint)
    • Line 43: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 52: warning: exported method MultiArrayStack.Peek should have comment or be unexported (golint)
    • Line 56: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 62: warning: exported method MultiArrayStack.IsEmpty should have comment or be unexported (golint)
    • Line 67: warning: exported method MultiArrayStack.AssertStackIndexIsWithinRange should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter3/4_queue_with_stacks.go
    • Line 7: warning: exported type QueueUsingStacks should have comment or be unexported (golint)
    • Line 12: warning: exported method QueueUsingStacks.Add should have comment or be unexported (golint)
    • Line 19: warning: exported method QueueUsingStacks.IsEmpty should have comment or be unexported (golint)
    • Line 23: warning: exported method QueueUsingStacks.Remove should have comment or be unexported (golint)
    • Line 52: warning: exported method QueueUsingStacks.Peek should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter3/stack.go
    • Line 7: warning: exported type StackNode should have comment or be unexported (golint)
    • Line 12: warning: exported type Stack should have comment or be unexported (golint)
    • Line 16: warning: exported method Stack.Pop should have comment or be unexported (golint)
    • Line 27: warning: exported method Stack.IsEmpty should have comment or be unexported (golint)
    • Line 31: warning: exported method Stack.Push should have comment or be unexported (golint)
    • Line 36: warning: exported method Stack.Peek should have comment or be unexported (golint)
    • Line 44: warning: exported method Stack.Empty should have comment or be unexported (golint)
    • Line 53: warning: exported method Stack.ToArray should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter4/7_build_order.go
    • Line 7: warning: exported type DependencyGraph should have comment or be unexported (golint)
    • Line 12: warning: exported method DependencyGraph.GetOrCreateNode should have comment or be unexported (golint)
    • Line 22: warning: exported method DependencyGraph.AddEdge should have comment or be unexported (golint)
    • Line 29: warning: exported method DependencyGraph.GetNodes should have comment or be unexported (golint)
    • Line 33: warning: exported type Project should have comment or be unexported (golint)
    • Line 40: warning: exported function CreateProject should have comment or be unexported (golint)
    • Line 49: warning: exported method Project.AddNeighbour should have comment or be unexported (golint)
    • Line 57: warning: exported method Project.GetName should have comment or be unexported (golint)
    • Line 61: warning: exported method Project.GetChildren should have comment or be unexported (golint)
    • Line 65: warning: exported method Project.GetNumberDependencies should have comment or be unexported (golint)
    • Line 69: warning: exported method Project.IncrementDependencies should have comment or be unexported (golint)
    • Line 73: warning: exported method Project.DecrementDependencies should have comment or be unexported (golint)
    • Line 77: warning: exported function BuildGraph should have comment or be unexported (golint)
    • Line 96: warning: exported function FindBuildOrder should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter3/3_stack_of_plates.go
    • Line 10: warning: exported type MultiDimensionalStack should have comment or be unexported (golint)
    • Line 14: warning: exported type NodeStack should have comment or be unexported (golint)
    • Line 18: warning: exported type LengthAwareStack should have comment or be unexported (golint)
    • Line 23: warning: exported method MultiDimensionalStack.Push should have comment or be unexported (golint)
    • Line 43: warning: exported method MultiDimensionalStack.IsEmpty should have comment or be unexported (golint)
    • Line 47: warning: exported method MultiDimensionalStack.PopAt should have comment or be unexported (golint)
    • Line 60: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 63: warning: exported method MultiDimensionalStack.Pop should have comment or be unexported (golint)
    • Line 80: warning: exported method MultiDimensionalStack.Print should have comment or be unexported (golint)
    • Line 101: warning: exported method MultiDimensionalStack.Peek should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter3/6_animal_shelter.go
    • Line 8: warning: exported type Shelter should have comment or be unexported (golint)
    • Line 12: warning: exported type AnimalNode should have comment or be unexported (golint)
    • Line 17: warning: exported const TypeDog should have comment or be unexported (golint)
    • Line 18: warning: exported const TypeCat should have comment or be unexported (golint)
    • Line 20: warning: exported function GetNewShelter should have comment or be unexported (golint)
    • Line 24: warning: exported method Shelter.Enqueue should have comment or be unexported (golint)
    • Line 28: warning: exported method Shelter.IsEmpty should have comment or be unexported (golint)
    • Line 32: warning: exported method Shelter.DequeueAny should have comment or be unexported (golint)
    • Line 43: warning: exported method Shelter.DequeueDog should have comment or be unexported (golint)
    • Line 61: warning: exported method Shelter.DequeueCat should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter2/singly_linked_list.go
    • Line 7: warning: exported type SinglyLinkedList should have comment or be unexported (golint)
    • Line 11: warning: exported type Node should have comment or be unexported (golint)
    • Line 85: warning: exported method SinglyLinkedList.Count should have comment or be unexported (golint)
    • Line 101: warning: exported method SinglyLinkedList.IsEmpty should have comment or be unexported (golint)
    • Line 105: warning: exported method SinglyLinkedList.Clone should have comment or be unexported (golint)
    • Line 121: warning: exported method SinglyLinkedList.Reverse should have comment or be unexported (golint)
    • Line 135: warning: exported method SinglyLinkedList.Slice should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter3/2_min_aware_stack.go
    • Line 7: warning: exported type MinAwareStack should have comment or be unexported (golint)
    • Line 12: warning: exported method MinAwareStack.Pop should have comment or be unexported (golint)
    • Line 25: warning: exported method MinAwareStack.IsEmpty should have comment or be unexported (golint)
    • Line 29: warning: exported method MinAwareStack.Push should have comment or be unexported (golint)
    • Line 42: warning: exported method MinAwareStack.Min should have comment or be unexported (golint)
    • Line 50: warning: exported method MinAwareStack.Peek should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter4/8_comon_ancestor.go
    • Line 5: warning: exported method ParentAwareBinaryTreeNode.CommonAncestor should have comment or be unexported (golint)
    • Line 35: warning: exported function GoUpBy should have comment or be unexported (golint)
    • Line 44: warning: exported function Depth should have comment or be unexported (golint)
    • Line 67: warning: exported method ParentAwareBinaryTreeNode.GetNodesAsSlice should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter8/6_towers_of_hanoi.go
    • Line 10: warning: exported type Tower should have comment or be unexported (golint)
    • Line 15: warning: exported function NewTower should have comment or be unexported (golint)
    • Line 22: warning: exported method Tower.Add should have comment or be unexported (golint)
    • Line 24: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 31: warning: exported method Tower.MoveTopTo should have comment or be unexported (golint)
    • Line 37: warning: exported method Tower.MoveDisks should have comment or be unexported (golint)
    • Line 52: warning: exported function SolveForN3 should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter3/queue.go
    • Line 7: warning: exported type QueueNode should have comment or be unexported (golint)
    • Line 12: warning: exported type Queue should have comment or be unexported (golint)
    • Line 16: warning: exported method Queue.Add should have comment or be unexported (golint)
    • Line 30: warning: exported method Queue.IsEmpty should have comment or be unexported (golint)
    • Line 34: warning: exported method Queue.Remove should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter4/4_binary_tree_is_balanced.go
    • Line 7: warning: exported method BinaryTreeNode.GetBinaryHeight should have comment or be unexported (golint)
    • Line 15: warning: exported method BinaryTreeNode.IsBalanced should have comment or be unexported (golint)
    • Line 29: warning: exported method BinaryTreeNode.CheckBalancedHeight should have comment or be unexported (golint)
    • Line 52: warning: exported method BinaryTreeNode.IsBalancedUsingHeightCheck should have comment or be unexported (golint)
    • cracking-the-coding-interview/chapter4/11_random_selecting_tree.go
    • Line 7: warning: exported type RandomTreeNode should have comment or be unexported (golint)
    • Line 13: warning: exported function NewRandomTreeNode should have comment or be unexported (golint)
    • Line 22: warning: exported method RandomTreeNode.GetRandomNode should have comment or be unexported (golint)
    • Line 44: warning: exported method RandomTreeNode.InsertInOrder should have comment or be unexported (golint)
    • Line 62: warning: exported method RandomTreeNode.Find should have comment or be unexported (golint)
    • Line 70: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • cracking-the-coding-interview/chapter2/7_intersection.go
    • Line 13: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 19: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


misspell97%

Misspell Finds commonly misspelled English words