pocka/rusted

View on GitHub

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,
Severity: Minor
Found in src/enum.js - About 1 hr to fix

    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} ;
    Severity: Minor
    Found in src/struct.js - About 1 hr to fix

      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
      Severity: Minor
      Found in src/impl.js - About 1 hr to fix

        Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports=function(grunt){
            grunt.initConfig({
                babel:{
                    options:{
                        presets:['es2015']
        Severity: Minor
        Found in Gruntfile.js - About 1 hr to fix

          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} ;
          Severity: Minor
          Found in src/struct.js - About 45 mins to fix

          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
          Severity: Minor
          Found in src/impl.js - About 45 mins to fix

          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;
          
          
          Severity: Minor
          Found in src/match.js - About 25 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language