Showing 7 of 19 total issues
Function factory
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
let factory=function(variants){
let EnumValue=function(name,data){
Object.defineProperties(this,{
'__rusted':{
value:true,
Function factory
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
let factory=function(def={}){
let prop_info=Object.keys(def).map((key)=>{
let {type,mutable}=def[key] instanceof Mutability
? {type:def[key].data,mutable:def[key].mutable}
: {type:def[key],mutable:false} ;
Function impl
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
let impl=function(/*trait?, target, block*/){
let trait=arguments[0] instanceof Trait
? arguments[0]
: null ,
target=trait
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports=function(grunt){
grunt.initConfig({
babel:{
options:{
presets:['es2015']
Function factory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
let factory=function(def={}){
let prop_info=Object.keys(def).map((key)=>{
let {type,mutable}=def[key] instanceof Mutability
? {type:def[key].data,mutable:def[key].mutable}
: {type:def[key],mutable:false} ;
- 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 impl
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
let impl=function(/*trait?, target, block*/){
let trait=arguments[0] instanceof Trait
? arguments[0]
: null ,
target=trait
- 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 match
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
let match=function(value,patterns){
let rusted=value.__rusted&&'__data' in value,
name=rusted?value.__name:value,
data=rusted?value.__data:value;
- 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"