smartxworks/kopilot

View on GitHub

Showing 7 of 9 total issues

Function main has 63 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func main() {
connectURL := ""
flag.StringVar(&connectURL, "connect", connectURL, "connect URL of kopilot-hub")
apiserverAddr := "kubernetes.default"
flag.StringVar(&apiserverAddr, "apiserver", apiserverAddr, "kube-apiserver address")
Severity: Minor
Found in cmd/kopilot-agent/main.go - About 1 hr to fix

    Method clusters.Patch has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) {
    Severity: Minor
    Found in pkg/client/clientset/versioned/typed/kopilot/v1alpha1/cluster.go - About 45 mins to fix

      Method FakeClusters.Patch has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Cluster, err error) {

        Method Manager.TryNextPeer has 6 return statements (exceeds 4 allowed).
        Open

        func (m *Manager) TryNextPeer(w http.ResponseWriter, r *http.Request, e error, key types.NamespacedName, nextPeer func() string) {
        peer := nextPeer()
        if peer == "" {
        w.WriteHeader(http.StatusBadGateway)
        return
        Severity: Major
        Found in pkg/hub/peer/server.go - About 40 mins to fix

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

          func NewProxyHandler(client clientset.Interface, sessionManager SessionManager, peerManager PeerManager, key types.NamespacedName, subpath string) http.Handler {
          Severity: Minor
          Found in pkg/hub/cluster/subresources.go - About 35 mins to fix

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

            func NewFilteredClusterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
            Severity: Minor
            Found in pkg/client/informers/externalversions/kopilot/v1alpha1/cluster.go - About 35 mins to fix

              Method Manager.TryNextPeer has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              func (m *Manager) TryNextPeer(w http.ResponseWriter, r *http.Request, e error, key types.NamespacedName, nextPeer func() string) {
              Severity: Minor
              Found in pkg/hub/peer/server.go - About 35 mins to fix
                Severity
                Category
                Status
                Source
                Language