Showing 12 of 12 total issues
Function _buildChunk
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
_buildChunk(tokens) {
let nextId = this.actuals.length;
// The raw html of this chunk.
const raw = [];
- Read upRead up
- Create a ticketCreate a ticket
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
File write-stream.js
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
import HtmlParser from 'prescribe';
import * as utils from './utils';
/**
* Turn on to debug how each chunk affected the DOM.
- Create a ticketCreate a ticket
Function _scriptLoadHandler
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
_scriptLoadHandler(el, done) {
function cleanup() {
el = el.onload = el.onreadystatechange = el.onerror = null;
}
- Read upRead up
- Create a ticketCreate a ticket
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 _scriptLoadHandler
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
_scriptLoadHandler(el, done) {
function cleanup() {
el = el.onload = el.onreadystatechange = el.onerror = null;
}
- Create a ticketCreate a ticket
Function runStream
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runStream(el, html, options) {
active = new WriteStream(el, options);
// Identify this stream.
active.id = nextId++;
- Create a ticketCreate a ticket
Function _buildChunk
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
_buildChunk(tokens) {
let nextId = this.actuals.length;
// The raw html of this chunk.
const raw = [];
- Create a ticketCreate a ticket
Function postscribe
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function postscribe(el, html, options) {
if (utils.isFunction(options)) {
options = {done: options};
} else if (options === 'clear') {
queue = [];
- Create a ticketCreate a ticket
Function postscribe
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export default function postscribe(el, html, options) {
if (utils.isFunction(options)) {
options = {done: options};
} else if (options === 'clear') {
queue = [];
- Read upRead up
- Create a ticketCreate a ticket
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 _walkChunk
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_walkChunk() {
let node;
const stack = [this.proxyRoot];
// use shift/unshift so that children are walked in document order
- Read upRead up
- Create a ticketCreate a ticket
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 _writeImpl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_writeImpl(html) {
this.parser.append(html);
let tok;
let script;
- Read upRead up
- Create a ticketCreate a ticket
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 _writeScriptToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_writeScriptToken(tok, done) {
const el = this._buildScript(tok);
const asyncRelease = this._shouldRelease(el);
const afterAsync = this.options.afterAsync;
- Read upRead up
- Create a ticketCreate a ticket
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 _handleScriptToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_handleScriptToken(tok) {
const remainder = this.parser.clear();
if (remainder) {
// Write remainder immediately behind this script.
- Read upRead up
- Create a ticketCreate a ticket
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"