docker/swarmkit

View on GitHub

Showing 1,008 of 1,820 total issues

Function parseResource has 11 return statements (exceeds 4 allowed).
Open

func parseResource(flags *pflag.FlagSet, spec *api.ServiceSpec) error {
    if flags.Changed("memory-reservation") {
        if spec.Task.Resources == nil {
            spec.Task.Resources = &api.ResourceRequirements{}
        }
Severity: Major
Found in swarmd/cmd/swarmctl/service/flagparser/resource.go - About 1 hr to fix

    Function renewCerts has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
    Open

    func renewCerts(swarmdir, unlockKey string) error {
        // First, load the existing cert.  We don't actually bother to check if
        // it's expired - this will just obtain a new cert anyway.
        krw, err := getKRW(swarmdir, unlockKey)
        if err != nil {
    Severity: Minor
    Found in swarmd/cmd/swarm-rafttool/renewcert.go - About 1 hr 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 controller.Logs has 11 return statements (exceeds 4 allowed).
    Open

    func (r *controller) Logs(ctx context.Context, publisher exec.LogPublisher, options api.LogSubscriptionOptions) error {
        if err := r.checkClosed(); err != nil {
            return err
        }
    
    
    Severity: Major
    Found in swarmd/dockerexec/controller.go - About 1 hr to fix

      Function skipHealth has 11 return statements (exceeds 4 allowed).
      Open

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

        Function ConvertConfigWatch has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
        Open

        func ConvertConfigWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
            var (
                m          Config
                checkFuncs []ConfigCheckFunc
            )
        Severity: Minor
        Found in api/objects.pb.go - About 1 hr 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 skipCa has 11 return statements (exceeds 4 allowed).
        Open

        func skipCa(dAtA []byte) (n int, err error) {
            l := len(dAtA)
            iNdEx := 0
            depth := 0
            for iNdEx < l {
        Severity: Major
        Found in api/ca.pb.go - About 1 hr to fix

          Method Service.MarshalToSizedBuffer has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
          Open

          func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) {
              i := len(dAtA)
              _ = i
              var l int
              _ = l
          Severity: Minor
          Found in api/objects.pb.go - About 1 hr 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 ConvertExtensionWatch has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
          Open

          func ConvertExtensionWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
              var (
                  m          Extension
                  checkFuncs []ExtensionCheckFunc
              )
          Severity: Minor
          Found in api/objects.pb.go - About 1 hr 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 ConvertClusterWatch has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
          Open

          func ConvertClusterWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
              var (
                  m          Cluster
                  checkFuncs []ClusterCheckFunc
              )
          Severity: Minor
          Found in api/objects.pb.go - About 1 hr 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 11 return statements (exceeds 4 allowed).
          Open

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

            Function ConvertSecretWatch has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
            Open

            func ConvertSecretWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                var (
                    m          Secret
                    checkFuncs []SecretCheckFunc
                )
            Severity: Minor
            Found in api/objects.pb.go - About 1 hr 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 ConvertNetworkWatch has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
            Open

            func ConvertNetworkWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                var (
                    m          Network
                    checkFuncs []NetworkCheckFunc
                )
            Severity: Minor
            Found in api/objects.pb.go - About 1 hr 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 ConvertVolumeWatch has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
            Open

            func ConvertVolumeWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                var (
                    m          Volume
                    checkFuncs []VolumeCheckFunc
                )
            Severity: Minor
            Found in api/objects.pb.go - About 1 hr 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 ConvertResourceWatch has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
            Open

            func ConvertResourceWatch(action WatchActionKind, filters []*SelectBy, kind string) ([]Event, error) {
                var (
                    m          Resource
                    checkFuncs []ResourceCheckFunc
                )
            Severity: Minor
            Found in api/objects.pb.go - About 1 hr 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 ConvertServiceWatch has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
            Open

            func ConvertServiceWatch(action WatchActionKind, filters []*SelectBy) ([]Event, error) {
                var (
                    m          Service
                    checkFuncs []ServiceCheckFunc
                )
            Severity: Minor
            Found in api/objects.pb.go - About 1 hr 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 11 return statements (exceeds 4 allowed).
            Open

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

              Method StoreSnapshot.MarshalToSizedBuffer has 11 return statements (exceeds 4 allowed).
              Open

              func (m *StoreSnapshot) MarshalToSizedBuffer(dAtA []byte) (int, error) {
                  i := len(dAtA)
                  _ = i
                  var l int
                  _ = l
              Severity: Major
              Found in api/snapshot.pb.go - About 1 hr to fix

                Function skipSnapshot has 11 return statements (exceeds 4 allowed).
                Open

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

                  Function skipObjects has 11 return statements (exceeds 4 allowed).
                  Open

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

                    Function skipLogbroker has 11 return statements (exceeds 4 allowed).
                    Open

                    func skipLogbroker(dAtA []byte) (n int, err error) {
                        l := len(dAtA)
                        iNdEx := 0
                        depth := 0
                        for iNdEx < l {
                    Severity: Major
                    Found in api/logbroker.pb.go - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language