meteor/meteor

View on GitHub
packages/test-in-browser/driver.js

Summary

Maintainability
D
2 days
Test Coverage

File driver.js has 421 lines of code (exceeds 250 allowed). Consider refactoring.
Open

////
//// Setup
////
import { diff_match_patch } from './diff_match_patch_uncompressed'
import 'bootstrap/dist/css/bootstrap.min.css';
Severity: Minor
Found in packages/test-in-browser/driver.js - About 6 hrs to fix

    Function get_details has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      get_details: function() {
    
        var details = this.details;
    
        if (! details) {
    Severity: Minor
    Found in packages/test-in-browser/driver.js - About 1 hr to fix

      Function _findTestForResults has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var _findTestForResults = function (results) {
        var groupPath = results.groupPath; // array
        if ((! Array.isArray(groupPath)) || (groupPath.length < 1)) {
          throw new Error("Test must be part of a group");
        }
      Severity: Minor
      Found in packages/test-in-browser/driver.js - About 1 hr to fix

        Function reportResults has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var reportResults = function(results) {
          var test = _findTestForResults(results);
        
          // Tolerate repeated reports: first undo the effect of any previous report
          var status = _testStatus(test);
        Severity: Minor
        Found in packages/test-in-browser/driver.js - About 1 hr to fix

          Function prepare has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                var prepare = function(details) {
                  if (type === 'string_equal') {
                    var diff = doDiff(details.actual,
                                      details.expected);
                  }
          Severity: Minor
          Found in packages/test-in-browser/driver.js - About 1 hr to fix

            Function reportResults has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            var reportResults = function(results) {
              var test = _findTestForResults(results);
            
              // Tolerate repeated reports: first undo the effect of any previous report
              var status = _testStatus(test);
            Severity: Minor
            Found in packages/test-in-browser/driver.js - 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 eventsArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              eventsArray: function() {
                var events = this.events.filter(function(e) {
                  return e.type != "finish";
                });
            
            
            Severity: Minor
            Found in packages/test-in-browser/driver.js - About 1 hr to fix

              Function _testTime has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              var _testTime = function(t) {
                if (t.events && t.events.length > 0) {
                  var lastEvent = t.events[t.events.length - 1];
                  if (lastEvent.type === "finish") {
                    if ((typeof lastEvent.timeMs) === "number") {
              Severity: Minor
              Found in packages/test-in-browser/driver.js - About 35 mins 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 get_details has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                get_details: function() {
              
                  var details = this.details;
              
                  if (! details) {
              Severity: Minor
              Found in packages/test-in-browser/driver.js - About 35 mins 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

              There are no issues that match your filters.

              Category
              Status