cloudfoundry-community/bosh-cloudstack-cpi

View on GitHub
go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js

Summary

Maintainability
D
2 days
Test Coverage

Function playground has 169 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function playground(opts) {
    var code = $(opts.codeEl);
    var transport = opts['transport'] || new HTTPTransport();
    var running;
  
Severity: Major
Found in go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js - About 6 hrs to fix

    File playground.js has 331 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // Copyright 2012 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    /*
    Severity: Minor
    Found in go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js - About 3 hrs to fix

      Function HTTPTransport has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

      function HTTPTransport() {
          'use strict';
      
          // TODO(adg): support stderr
      
      
      Severity: Minor
      Found in go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js - About 2 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 HTTPTransport has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function HTTPTransport() {
          'use strict';
      
          // TODO(adg): support stderr
      
      
      Severity: Major
      Found in go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js - About 2 hrs to fix

        Function SocketTransport has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function SocketTransport() {
            'use strict';
        
            var id = 0;
            var outputs = {};
        Severity: Minor
        Found in go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js - About 1 hr to fix

          Function PlaygroundOutput has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function PlaygroundOutput(el) {
              'use strict';
          
              return function(write) {
                  if (write.Kind == 'start') {
          Severity: Minor
          Found in go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js - About 1 hr to fix

            Function Run has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    Run: function(body, output, options) {
                        seq++;
                        var cur = seq;
                        var playing;
                        $.ajax('/compile', {
            Severity: Minor
            Found in go_agent/src/code.google.com/p/go.tools/godoc/static/playground.js - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status