docker/swarmkit

View on GitHub

Showing 1,820 of 1,820 total issues

Method Supervisor.Restart has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

func (r *Supervisor) Restart(ctx context.Context, tx store.Tx, cluster *api.Cluster, service *api.Service, t api.Task) error {
Severity: Minor
Found in manager/orchestrator/restart/restart.go - About 35 mins to fix

    Function CheckTasks has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func CheckTasks(ctx context.Context, s *store.MemoryStore, readTx store.ReadTx, initHandler InitHandler, startSupervisor restart.SupervisorInterface) error {
    Severity: Minor
    Found in manager/orchestrator/taskinit/init.go - About 35 mins to fix

      Function validateHasAtLeastOneExternalCA has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func validateHasAtLeastOneExternalCA(ctx context.Context, externalCAs map[string][]*api.ExternalCA, securityConfig *ca.SecurityConfig,
          wantedCert []byte, desc string) ([]*api.ExternalCA, error) {
      Severity: Minor
      Found in manager/controlapi/ca_rotation.go - About 35 mins to fix

        Function watchTask has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func watchTask(t *testing.T, s *store.MemoryStore, watch chan events.Event, expectTimeout bool, fn func(t assert.TestingT, s *store.MemoryStore, n *api.Task) bool) {
        Severity: Minor
        Found in manager/allocator/allocator_test_suite.go - About 35 mins to fix

          Method nodeSet.tree has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func (ns *nodeSet) tree(serviceID string, preferences []*api.PlacementPreference, maxAssignments int, meetsConstraints func(*NodeInfo) bool, nodeLess func(*NodeInfo, *NodeInfo) bool) decisionTree {
          Severity: Minor
          Found in manager/scheduler/nodeset.go - About 35 mins to fix

            Function NewServer has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func NewServer(store *store.MemoryStore, raft *raft.Node, securityConfig *ca.SecurityConfig, nv networkallocator.DriverValidator, dr *drivers.DriverProvider) *Server {
            Severity: Minor
            Found in manager/controlapi/server.go - About 35 mins to fix

              Function NewJoinNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func NewJoinNode(t *testing.T, clockSource *fakeclock.FakeClock, join string, tc *cautils.TestCA, opts ...raft.NodeOptions) *TestNode {
              Severity: Minor
              Found in manager/state/raft/testutils/testutils.go - About 35 mins to fix

                Function CheckValuesOnNodes has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                func CheckValuesOnNodes(t *testing.T, clockSource *fakeclock.FakeClock, checkNodes map[uint64]*TestNode, ids []string, values []*api.Node) {
                Severity: Minor
                Found in manager/state/raft/testutils/testutils.go - About 35 mins to fix

                  Function CopyNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  func CopyNode(t *testing.T, clockSource *fakeclock.FakeClock, oldNode *TestNode, forceNewCluster bool, kr *SimpleKeyRotator) (*TestNode, context.Context) {
                  Severity: Minor
                  Found in manager/state/raft/testutils/testutils.go - About 35 mins to fix

                    Function AddRaftNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    func AddRaftNode(t *testing.T, clockSource *fakeclock.FakeClock, nodes map[uint64]*TestNode, tc *cautils.TestCA, opts ...raft.NodeOptions) {
                    Severity: Minor
                    Found in manager/state/raft/testutils/testutils.go - About 35 mins to fix

                      Method Node.saveToStorage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          ctx context.Context,
                          raftConfig *api.RaftConfig,
                          hardState raftpb.HardState,
                          entries []raftpb.Entry,
                          snapshot raftpb.Snapshot,
                      Severity: Minor
                      Found in manager/state/raft/raft.go - About 35 mins to fix

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

                        func (c *dispatcherClient) UpdateVolumeStatus(ctx context.Context, in *UpdateVolumeStatusRequest, opts ...grpc.CallOption) (*UpdateVolumeStatusResponse, error) {
                            out := new(UpdateVolumeStatusResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/UpdateVolumeStatus", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/dispatcher.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 599..606
                        api/ca.pb.go on lines 608..615
                        api/ca.pb.go on lines 709..716
                        api/ca.pb.go on lines 718..725
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1425..1432
                        api/health.pb.go on lines 245..252
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1183..1190
                        api/raft.pb.go on lines 1328..1335
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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 14 locations. Consider refactoring.
                        Open

                        func (c *cAClient) GetRootCACertificate(ctx context.Context, in *GetRootCACertificateRequest, opts ...grpc.CallOption) (*GetRootCACertificateResponse, error) {
                            out := new(GetRootCACertificateResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetRootCACertificate", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/ca.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 608..615
                        api/ca.pb.go on lines 709..716
                        api/ca.pb.go on lines 718..725
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1425..1432
                        api/dispatcher.pb.go on lines 1434..1441
                        api/health.pb.go on lines 245..252
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1183..1190
                        api/raft.pb.go on lines 1328..1335
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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 14 locations. Consider refactoring.
                        Open

                        func (c *cAClient) GetUnlockKey(ctx context.Context, in *GetUnlockKeyRequest, opts ...grpc.CallOption) (*GetUnlockKeyResponse, error) {
                            out := new(GetUnlockKeyResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.CA/GetUnlockKey", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/ca.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 599..606
                        api/ca.pb.go on lines 709..716
                        api/ca.pb.go on lines 718..725
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1425..1432
                        api/dispatcher.pb.go on lines 1434..1441
                        api/health.pb.go on lines 245..252
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1183..1190
                        api/raft.pb.go on lines 1328..1335
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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 14 locations. Consider refactoring.
                        Open

                        func (c *dispatcherClient) UpdateTaskStatus(ctx context.Context, in *UpdateTaskStatusRequest, opts ...grpc.CallOption) (*UpdateTaskStatusResponse, error) {
                            out := new(UpdateTaskStatusResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Dispatcher/UpdateTaskStatus", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/dispatcher.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 599..606
                        api/ca.pb.go on lines 608..615
                        api/ca.pb.go on lines 709..716
                        api/ca.pb.go on lines 718..725
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1434..1441
                        api/health.pb.go on lines 245..252
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1183..1190
                        api/raft.pb.go on lines 1328..1335
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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 14 locations. Consider refactoring.
                        Open

                        func (c *healthClient) Check(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error) {
                            out := new(HealthCheckResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Health/Check", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/health.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 599..606
                        api/ca.pb.go on lines 608..615
                        api/ca.pb.go on lines 709..716
                        api/ca.pb.go on lines 718..725
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1425..1432
                        api/dispatcher.pb.go on lines 1434..1441
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1183..1190
                        api/raft.pb.go on lines 1328..1335
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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 14 locations. Consider refactoring.
                        Open

                        func (c *nodeCAClient) NodeCertificateStatus(ctx context.Context, in *NodeCertificateStatusRequest, opts ...grpc.CallOption) (*NodeCertificateStatusResponse, error) {
                            out := new(NodeCertificateStatusResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.NodeCA/NodeCertificateStatus", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/ca.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 599..606
                        api/ca.pb.go on lines 608..615
                        api/ca.pb.go on lines 709..716
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1425..1432
                        api/dispatcher.pb.go on lines 1434..1441
                        api/health.pb.go on lines 245..252
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1183..1190
                        api/raft.pb.go on lines 1328..1335
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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 14 locations. Consider refactoring.
                        Open

                        func (c *nodeCAClient) IssueNodeCertificate(ctx context.Context, in *IssueNodeCertificateRequest, opts ...grpc.CallOption) (*IssueNodeCertificateResponse, error) {
                            out := new(IssueNodeCertificateResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.NodeCA/IssueNodeCertificate", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/ca.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 599..606
                        api/ca.pb.go on lines 608..615
                        api/ca.pb.go on lines 718..725
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1425..1432
                        api/dispatcher.pb.go on lines 1434..1441
                        api/health.pb.go on lines 245..252
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1183..1190
                        api/raft.pb.go on lines 1328..1335
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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 14 locations. Consider refactoring.
                        Open

                        func (c *raftMembershipClient) Join(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) {
                            out := new(JoinResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.RaftMembership/Join", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/raft.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 599..606
                        api/ca.pb.go on lines 608..615
                        api/ca.pb.go on lines 709..716
                        api/ca.pb.go on lines 718..725
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1425..1432
                        api/dispatcher.pb.go on lines 1434..1441
                        api/health.pb.go on lines 245..252
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1183..1190
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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 14 locations. Consider refactoring.
                        Open

                        func (c *raftClient) ResolveAddress(ctx context.Context, in *ResolveAddressRequest, opts ...grpc.CallOption) (*ResolveAddressResponse, error) {
                            out := new(ResolveAddressResponse)
                            err := c.cc.Invoke(ctx, "/docker.swarmkit.v1.Raft/ResolveAddress", in, out, opts...)
                            if err != nil {
                                return nil, err
                        Severity: Major
                        Found in api/raft.pb.go and 13 other locations - About 35 mins to fix
                        api/ca.pb.go on lines 599..606
                        api/ca.pb.go on lines 608..615
                        api/ca.pb.go on lines 709..716
                        api/ca.pb.go on lines 718..725
                        api/dispatcher.pb.go on lines 1416..1423
                        api/dispatcher.pb.go on lines 1425..1432
                        api/dispatcher.pb.go on lines 1434..1441
                        api/health.pb.go on lines 245..252
                        api/raft.pb.go on lines 1140..1147
                        api/raft.pb.go on lines 1328..1335
                        api/raft.pb.go on lines 1337..1344
                        api/resource.pb.go on lines 335..342
                        api/resource.pb.go on lines 344..351

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

                        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