dotcloud/docker

View on GitHub
daemon/cluster/convert/swarm.go

Summary

Maintainability
A
2 hrs
Test Coverage

Function SwarmFromGRPC has 55 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func SwarmFromGRPC(c swarmapi.Cluster) types.Swarm {
    swarm := types.Swarm{
        ClusterInfo: types.ClusterInfo{
            ID: c.ID,
            Spec: types.Spec{
Severity: Minor
Found in daemon/cluster/convert/swarm.go - About 1 hr to fix

    Function MergeSwarmSpecToGRPC has 51 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func MergeSwarmSpecToGRPC(s types.Spec, spec swarmapi.ClusterSpec) (swarmapi.ClusterSpec, error) {
        // We take the initSpec (either created from scratch, or returned by swarmkit),
        // and will only change the value if the one taken from types.Spec is not nil or 0.
        // In other words, if the value taken from types.Spec is nil or 0, we will maintain the status quo.
        if s.Annotations.Name != "" {
    Severity: Minor
    Found in daemon/cluster/convert/swarm.go - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status