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';
Function get_details
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
get_details: function() {
var details = this.details;
if (! details) {
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");
}
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);
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);
}
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);
- Read upRead up
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";
});
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") {
- Read upRead up
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) {
- Read upRead up
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"