Showing 9 of 19 total issues
Function inferThrows
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function inferThrows(fun, commentObj, fileName){
traverse(fun, {pre: function(node, parent, prop, idx) {
// console.log(node.type + (parent ? " from parent " + parent.type +
// " via " + prop + (idx !== undefined ? "[" + idx + "]" : "") : ""));
- 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 inferThrows
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function inferThrows(fun, commentObj, fileName){
traverse(fun, {pre: function(node, parent, prop, idx) {
// console.log(node.type + (parent ? " from parent " + parent.type +
// " via " + prop + (idx !== undefined ? "[" + idx + "]" : "") : ""));
Function doesItThrow
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ASTParser.prototype.doesItThrow = function(fun){
var tTypes = [];
traverse(fun, {pre: function(node, parent, prop, idx) {
// console.log(node.type + (parent ? " from parent " + parent.type +
// " via " + prop + (idx !== undefined ? "[" + idx + "]" : "") : ""));
- 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 generateComment
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateComment(fun, fileName){
var comment = new Comment();
if(fun.id)
comment.name = fun.id.name;
Function annotate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
JSDocGen.prototype.annotate = function(fileName, fileData){
if(!inferencePromises[fileName])
inferencePromises[fileName] = [];
Function pre
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
traverse(fun, {pre: function(node, parent, prop, idx) {
// console.log(node.type + (parent ? " from parent " + parent.type +
// " via " + prop + (idx !== undefined ? "[" + idx + "]" : "") : ""));
if(node.type === 'TryStatement' || (node.type !== 'CatchClause' && parent && parent.catching)){
node.catching = true;
Function annotate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
JSDocGen.prototype.annotate = function(fileName, fileData){
if(!inferencePromises[fileName])
inferencePromises[fileName] = [];
- 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 toString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Comment.prototype.toString = function(){
var commentString = '*\n * ';
commentString += this.name;
commentString += '\n * ';
for(let p of this.params){
- 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 doesItReturn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ASTParser.prototype.doesItReturn = function(fun){
var rTypes = [];
traverse(fun, {pre: function(node, parent, prop, idx) {
// console.log(node.type + (parent ? " from parent " + parent.type +
// " via " + prop + (idx !== undefined ? "[" + idx + "]" : "") : ""));
- 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"