docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

Function skipHealth has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipHealth(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/health.pb.go - About 5 hrs to fix

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

Function skipObjects has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipObjects(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/objects.pb.go - About 5 hrs to fix

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

Function skipResource has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipResource(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/resource.pb.go - About 5 hrs to fix

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

Function skipLogbroker has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipLogbroker(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/logbroker.pb.go - About 5 hrs to fix

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

Function skipSnapshot has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipSnapshot(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/snapshot.pb.go - About 5 hrs to fix

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

Function skipDispatcher has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipDispatcher(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/dispatcher.pb.go - About 5 hrs to fix

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

Function skipRaft has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipRaft(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/raft.pb.go - About 5 hrs to fix

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

Function skipWatch has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipWatch(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/watch.pb.go - About 5 hrs to fix

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

Function skipSpecs has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipSpecs(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in api/specs.pb.go - About 5 hrs to fix

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

Function skipPlugin has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func skipPlugin(dAtA []byte) (n int, err error) {
    l := len(dAtA)
    iNdEx := 0
    depth := 0
    for iNdEx < l {
Severity: Minor
Found in protobuf/plugin/plugin.pb.go - About 5 hrs to fix

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 Node.loadAndStart has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
Open

func (n *Node) loadAndStart(ctx context.Context, forceNewCluster bool) error {
    snapshot, waldata, err := n.readFromDisk(ctx)
    if err != nil {
        return err
    }
Severity: Minor
Found in manager/state/raft/storage.go - About 5 hrs to fix

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 SubscriptionMessage.Unmarshal has 171 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (m *SubscriptionMessage) Unmarshal(dAtA []byte) error {
    l := len(dAtA)
    iNdEx := 0
    for iNdEx < l {
        preIndex := iNdEx
Severity: Major
Found in api/logbroker.pb.go - About 5 hrs to fix

    Similar blocks of code found in 10 locations. Consider refactoring.
    Open

    func NewRaftProxyRaftServer(local RaftServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) RaftServer {
        redirectChecker := func(ctx context.Context) (context.Context, error) {
            p, ok := peer.FromContext(ctx)
            if !ok {
                return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
    Severity: Major
    Found in api/raft.pb.go and 9 other locations - About 5 hrs to fix
    api/ca.pb.go on lines 1094..1125
    api/ca.pb.go on lines 1236..1267
    api/dispatcher.pb.go on lines 2449..2480
    api/health.pb.go on lines 378..409
    api/logbroker.pb.go on lines 1722..1753
    api/logbroker.pb.go on lines 1845..1876
    api/raft.pb.go on lines 2291..2322
    api/resource.pb.go on lines 570..601
    api/watch.pb.go on lines 2155..2186

    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 415.

    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

    Further Reading

    Similar blocks of code found in 10 locations. Consider refactoring.
    Open

    func NewRaftProxyLogBrokerServer(local LogBrokerServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) LogBrokerServer {
        redirectChecker := func(ctx context.Context) (context.Context, error) {
            p, ok := peer.FromContext(ctx)
            if !ok {
                return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
    Severity: Major
    Found in api/logbroker.pb.go and 9 other locations - About 5 hrs to fix
    api/ca.pb.go on lines 1094..1125
    api/ca.pb.go on lines 1236..1267
    api/dispatcher.pb.go on lines 2449..2480
    api/health.pb.go on lines 378..409
    api/logbroker.pb.go on lines 1722..1753
    api/raft.pb.go on lines 2092..2123
    api/raft.pb.go on lines 2291..2322
    api/resource.pb.go on lines 570..601
    api/watch.pb.go on lines 2155..2186

    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 415.

    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

    Further Reading

    Similar blocks of code found in 10 locations. Consider refactoring.
    Open

    func NewRaftProxyCAServer(local CAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) CAServer {
        redirectChecker := func(ctx context.Context) (context.Context, error) {
            p, ok := peer.FromContext(ctx)
            if !ok {
                return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
    Severity: Major
    Found in api/ca.pb.go and 9 other locations - About 5 hrs to fix
    api/ca.pb.go on lines 1236..1267
    api/dispatcher.pb.go on lines 2449..2480
    api/health.pb.go on lines 378..409
    api/logbroker.pb.go on lines 1722..1753
    api/logbroker.pb.go on lines 1845..1876
    api/raft.pb.go on lines 2092..2123
    api/raft.pb.go on lines 2291..2322
    api/resource.pb.go on lines 570..601
    api/watch.pb.go on lines 2155..2186

    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 415.

    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

    Further Reading

    Similar blocks of code found in 10 locations. Consider refactoring.
    Open

    func NewRaftProxyNodeCAServer(local NodeCAServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) NodeCAServer {
        redirectChecker := func(ctx context.Context) (context.Context, error) {
            p, ok := peer.FromContext(ctx)
            if !ok {
                return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
    Severity: Major
    Found in api/ca.pb.go and 9 other locations - About 5 hrs to fix
    api/ca.pb.go on lines 1094..1125
    api/dispatcher.pb.go on lines 2449..2480
    api/health.pb.go on lines 378..409
    api/logbroker.pb.go on lines 1722..1753
    api/logbroker.pb.go on lines 1845..1876
    api/raft.pb.go on lines 2092..2123
    api/raft.pb.go on lines 2291..2322
    api/resource.pb.go on lines 570..601
    api/watch.pb.go on lines 2155..2186

    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 415.

    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

    Further Reading

    Similar blocks of code found in 10 locations. Consider refactoring.
    Open

    func NewRaftProxyHealthServer(local HealthServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) HealthServer {
        redirectChecker := func(ctx context.Context) (context.Context, error) {
            p, ok := peer.FromContext(ctx)
            if !ok {
                return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
    Severity: Major
    Found in api/health.pb.go and 9 other locations - About 5 hrs to fix
    api/ca.pb.go on lines 1094..1125
    api/ca.pb.go on lines 1236..1267
    api/dispatcher.pb.go on lines 2449..2480
    api/logbroker.pb.go on lines 1722..1753
    api/logbroker.pb.go on lines 1845..1876
    api/raft.pb.go on lines 2092..2123
    api/raft.pb.go on lines 2291..2322
    api/resource.pb.go on lines 570..601
    api/watch.pb.go on lines 2155..2186

    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 415.

    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

    Further Reading

    Similar blocks of code found in 10 locations. Consider refactoring.
    Open

    func NewRaftProxyDispatcherServer(local DispatcherServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) DispatcherServer {
        redirectChecker := func(ctx context.Context) (context.Context, error) {
            p, ok := peer.FromContext(ctx)
            if !ok {
                return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
    Severity: Major
    Found in api/dispatcher.pb.go and 9 other locations - About 5 hrs to fix
    api/ca.pb.go on lines 1094..1125
    api/ca.pb.go on lines 1236..1267
    api/health.pb.go on lines 378..409
    api/logbroker.pb.go on lines 1722..1753
    api/logbroker.pb.go on lines 1845..1876
    api/raft.pb.go on lines 2092..2123
    api/raft.pb.go on lines 2291..2322
    api/resource.pb.go on lines 570..601
    api/watch.pb.go on lines 2155..2186

    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 415.

    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

    Further Reading

    Similar blocks of code found in 10 locations. Consider refactoring.
    Open

    func NewRaftProxyLogsServer(local LogsServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) LogsServer {
        redirectChecker := func(ctx context.Context) (context.Context, error) {
            p, ok := peer.FromContext(ctx)
            if !ok {
                return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
    Severity: Major
    Found in api/logbroker.pb.go and 9 other locations - About 5 hrs to fix
    api/ca.pb.go on lines 1094..1125
    api/ca.pb.go on lines 1236..1267
    api/dispatcher.pb.go on lines 2449..2480
    api/health.pb.go on lines 378..409
    api/logbroker.pb.go on lines 1845..1876
    api/raft.pb.go on lines 2092..2123
    api/raft.pb.go on lines 2291..2322
    api/resource.pb.go on lines 570..601
    api/watch.pb.go on lines 2155..2186

    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 415.

    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

    Further Reading

    Similar blocks of code found in 10 locations. Consider refactoring.
    Open

    func NewRaftProxyWatchServer(local WatchServer, connSelector raftselector.ConnProvider, localCtxMod, remoteCtxMod func(context.Context) (context.Context, error)) WatchServer {
        redirectChecker := func(ctx context.Context) (context.Context, error) {
            p, ok := peer.FromContext(ctx)
            if !ok {
                return ctx, status.Errorf(codes.InvalidArgument, "remote addr is not found in context")
    Severity: Major
    Found in api/watch.pb.go and 9 other locations - About 5 hrs to fix
    api/ca.pb.go on lines 1094..1125
    api/ca.pb.go on lines 1236..1267
    api/dispatcher.pb.go on lines 2449..2480
    api/health.pb.go on lines 378..409
    api/logbroker.pb.go on lines 1722..1753
    api/logbroker.pb.go on lines 1845..1876
    api/raft.pb.go on lines 2092..2123
    api/raft.pb.go on lines 2291..2322
    api/resource.pb.go on lines 570..601

    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 415.

    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

    Further Reading

    Severity
    Category
    Status
    Source
    Language