cybrilla/parata

View on GitHub

Showing 6 of 10 total issues

Function Parser has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function Parser() {
  var that = this,
      styleFilePath,
      exampleFilePath,
      styleContents,
Severity: Major
Found in lib/parser.js - About 3 hrs to fix

    Function Parser has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

    function Parser() {
      var that = this,
          styleFilePath,
          exampleFilePath,
          styleContents,
    Severity: Minor
    Found in lib/parser.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 exports has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function() {
      var that = this,
          attr;
    
      // Create data attributes for the component
    Severity: Minor
    Found in lib/component.js - About 1 hr to fix

      Function generateExampleMarkup has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        that.generateExampleMarkup = function() {
          var variants = attr.get('variants'),
              i, length,
              template = Handlebars.compile(attr.get('rawExample')),
              data = {
      Severity: Minor
      Found in lib/component.js - About 1 hr to fix

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

        module.exports = function() {
          var that = this,
              attr;
        
          // Create data attributes for the component
        Severity: Minor
        Found in lib/component.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 getComponents has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        var getComponents = function(srcPath, styleExt, dest) {
          var list = fs.readdirSync(srcPath),
              i, length,
              j, rlength,
              stat,
        Severity: Minor
        Found in tasks/lib/build.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