File types.go
has 1006 lines of code (exceeds 500 allowed). Consider refactoring. Wontfix
// Package api holds declarations for types used in ipfs-cluster APIs to make
// them re-usable across differen tools. This include RPC API "Serial[izable]"
// versions for types. The Go API uses natives types, while RPC API,
// REST APIs etc use serializable types (i.e. json format). Conversion methods
// exists between types.
Method PinOptions.FromQuery
has a Cognitive Complexity of 32 (exceeds 15 allowed). Consider refactoring. Open
func (po *PinOptions) FromQuery(q url.Values) error {
po.Name = q.Get("name")
po.Mode = PinModeFromString(q.Get("mode"))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method PinOptions.Equals
has a Cognitive Complexity of 21 (exceeds 15 allowed). Consider refactoring. Open
func (po PinOptions) Equals(po2 PinOptions) bool {
if po.Name != po2.Name {
return false
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method PinOptions.Equals
has 12 return statements (exceeds 10 allowed). Open
func (po PinOptions) Equals(po2 PinOptions) bool {
if po.Name != po2.Name {
return false
}
Method Pin.ProtoUnmarshal
has a Cognitive Complexity of 17 (exceeds 15 allowed). Consider refactoring. Open
func (pin *Pin) ProtoUnmarshal(data []byte) error {
pbPin := pb.Pin{}
err := proto.Unmarshal(data, &pbPin)
if err != nil {
return err
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
FIXME found Confirmed
// FIXME include maxdepth
- Exclude checks
FIXME found Confirmed
// FIXME: when we know how ipfs returns partial pins.
- Exclude checks
FIXME found Confirmed
// FIXME: Maxdepth?
- Exclude checks