Function ParagraphParser
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function ParagraphParser() {
var self = this,
block_is_license_block = false,
block_has_c_style_comment,
is_first_line_in_paragraph,
- 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 ParagraphParser
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ParagraphParser() {
var self = this,
block_is_license_block = false,
block_has_c_style_comment,
is_first_line_in_paragraph,
Function RtfGenerator
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function RtfGenerator() {
var self = this,
did_write_anything = false;
Stream.call(this);
- 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 RtfGenerator
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function RtfGenerator() {
var self = this,
did_write_anything = false;
Stream.call(this);
Function Unwrapper
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function Unwrapper() {
var self = this;
Stream.call(this);
this.writable = true;
- 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 parseLine
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseLine(line) {
// Strip trailing whitespace
line = line.replace(/\s*$/, '');
// Detect block separator
Function Unwrapper
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Unwrapper() {
var self = this;
Stream.call(this);
this.writable = true;
Function write
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.write = function(paragraph) {
if (!did_write_anything) {
emitHeader();
did_write_anything = true;
}