brenolf/polyjuice

View on GitHub

Showing 9 of 9 total issues

Function exports has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function(dictionary, truth_fn, truth_tbl, current) {
  this.dictionary = dictionary
  this.truth_fn = truth_fn
  this.truth_tbl = truth_tbl
  this.current = current || {}
Severity: Minor
Found in lib/polyjuice/reader.js - About 4 hrs 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 exports has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function(dictionary, truth_fn, truth_tbl, current) {
  this.dictionary = dictionary
  this.truth_fn = truth_fn
  this.truth_tbl = truth_tbl
  this.current = current || {}
Severity: Minor
Found in lib/polyjuice/reader.js - About 1 hr to fix

    Function exports has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function(dictionary, json_data, truth_tbl, discarded) {
      var output = {}
    
      discarded = discarded || []
    
    
    Severity: Minor
    Found in lib/polyjuice/interpreter.js - About 1 hr 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 get has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.get = function(key, value) {
        var read = that.dictionary[key]
    
        if (!read || value === null || value === 'undefined') {
          return {}
    Severity: Minor
    Found in lib/polyjuice/reader.js - About 1 hr to fix

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

      module.exports = function(filename, log, encoding) {
        encoding = encoding || 'utf8'
      
        var data = {}
      
      
      Severity: Minor
      Found in lib/polyjuice/jshint.js - About 1 hr to fix

        Function eval has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          eval: function(__current__, value) {
            if (value[0] === 0 || value === 0) {
              return {}
            }
        
        
        Severity: Minor
        Found in lib/dictionaries/eslint/space-in-parens.js - About 55 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 eval has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          eval: function(__current__, value) {
            var result = true
            var verb = 'require'
            var obj = {}
        
        
        Severity: Minor
        Found in lib/dictionaries/eslint/array-bracket-spacing.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 eval has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          eval: function(__current__, value) {
            if (value[0] === 0 || value === 0) {
              return {}
            }
        
        
        Severity: Minor
        Found in lib/dictionaries/eslint/key-spacing.js - About 35 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 truthy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          truthy: function(__current__, value) {
            if (value === 'all' || value === true) {
              return [2, 'always']
            }
        
        
        Severity: Minor
        Found in lib/dictionaries/jscs/requireSpacesInsideObjectBrackets.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