Showing 1,820 of 1,820 total issues
Method AttachNetworkRequest.Unmarshal
has 22 return statements (exceeds 4 allowed). Open
func (m *AttachNetworkRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
Method GetUnlockKeyResponse.Unmarshal
has 22 return statements (exceeds 4 allowed). Open
func (m *GetUnlockKeyResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
Method UpdateVolumeStatusRequest.Unmarshal
has 22 return statements (exceeds 4 allowed). Open
func (m *UpdateVolumeStatusRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
Method SessionRequest.Unmarshal
has 22 return statements (exceeds 4 allowed). Open
func (m *SessionRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
Method UpdateTaskStatusRequest.Unmarshal
has 22 return statements (exceeds 4 allowed). Open
func (m *UpdateTaskStatusRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
Method UpdateTaskStatusRequest_TaskStatusUpdate.Unmarshal
has 22 return statements (exceeds 4 allowed). Open
func (m *UpdateTaskStatusRequest_TaskStatusUpdate) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
Method GenericRuntimeSpec.Unmarshal
has 22 return statements (exceeds 4 allowed). Open
func (m *GenericRuntimeSpec) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
Method testSuite.TestAllocator
has 22 return statements (exceeds 4 allowed). Open
func (suite *testSuite) TestAllocator() {
s := store.NewMemoryStore(nil)
suite.NotNil(s)
defer s.Close()
a := suite.newAllocator(s)
Method Node.Join
has 75 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (n *Node) Join(ctx context.Context, req *api.JoinRequest) (*api.JoinResponse, error) {
nodeInfo, err := ca.RemoteNode(ctx)
if err != nil {
return nil, err
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
func (m *SelectByCustom) Size() (n int) {
if m == nil {
return 0
}
var l int
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 190.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
func (m *LogContext) Size() (n int) {
if m == nil {
return 0
}
var l int
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 190.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function ConvertNodeWatch
has 74 lines of code (exceeds 50 allowed). Consider refactoring. Open
func ConvertNodeWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
var (
m Node
checkFuncs []NodeCheckFunc
hasRole bool
Similar blocks of code found in 2 locations. Consider refactoring. Open
var (
inspectCmd = &cobra.Command{
Use: "inspect <cluster name>",
Short: "Inspect a cluster",
RunE: func(cmd *cobra.Command, args []string) error {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 187.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
var (
inspectCmd = &cobra.Command{
Use: "inspect <network ID>",
Short: "Inspect a network",
RunE: func(cmd *cobra.Command, args []string) error {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 187.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function Merge
has 73 lines of code (exceeds 50 allowed). Consider refactoring. Open
func Merge(cmd *cobra.Command, spec *api.ServiceSpec, c api.ControlClient) error {
flags := cmd.Flags()
if flags.Changed("force") {
force, err := flags.GetBool("force")
Method testSuite.TestAllocateServiceConflictingUserDefinedPorts
has 73 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (suite *testSuite) TestAllocateServiceConflictingUserDefinedPorts() {
s := store.NewMemoryStore(nil)
suite.NotNil(s)
defer s.Close()
Method testSuite.TestNodeAttachmentOnLeadershipChange
has 73 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (suite *testSuite) TestNodeAttachmentOnLeadershipChange() {
s := store.NewMemoryStore(nil)
suite.NotNil(s)
defer s.Close()
Function EventFromStoreAction
has 21 return statements (exceeds 4 allowed). Open
func EventFromStoreAction(sa StoreAction, oldObject StoreObject) (Event, error) {
switch v := sa.Target.(type) {
case *StoreAction_Node:
switch sa.Action {
case StoreActionKindCreate:
Method Endpoint_VirtualIP.Unmarshal
has 21 return statements (exceeds 4 allowed). Open
func (m *Endpoint_VirtualIP) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
Function WatchMessageEvent
has 21 return statements (exceeds 4 allowed). Open
func WatchMessageEvent(c Event) *WatchMessage_Event {
switch v := c.(type) {
case EventCreateNode:
return &WatchMessage_Event{Action: WatchActionKindCreate, Object: &Object{Object: &Object_Node{Node: v.Node}}}
case EventUpdateNode: