rubeniskov/templatefy

View on GitHub

Showing 7 of 10 total issues

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

module.exports = function(template, data, opts) {
  var regex,
      lDel,
      rDel,
      delLen,
Severity: Minor
Found in lib/templatefy-interpolate.js - About 1 hr to fix

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

    module.exports = function(grunt) {
        grunt.initConfig({
            'npm-publish': {
                options: {
                    abortIfDirty: true,
    Severity: Minor
    Found in Gruntfile.js - About 1 hr to fix

      Function parse has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Templatefy.parse = function() {
              var curs = 0,
                  stdo = through(),
                  args = Array.prototype.slice.call(arguments),
                  data = '',
      Severity: Minor
      Found in lib/templatefy.js - About 1 hr to fix

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

        module.exports = function(options, templates){
            return function(data){
                var parser = {
                        data: data,
                        parse: function parse(option, transform){
        Severity: Minor
        Found in lib/templatefy-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 _ouput has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            Templatefy._ouput = function(std) {
                if (std instanceof stream && std.writable) {
                    return std;
                } else if (typeof(std) === 'string') {
                    if (std === 'stdout') {
        Severity: Minor
        Found in lib/templatefy.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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            Templatefy.parse = function() {
                var curs = 0,
                    stdo = through(),
                    args = Array.prototype.slice.call(arguments),
                    data = '',
        Severity: Minor
        Found in lib/templatefy.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 _input has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            Templatefy._input = function(std) {
                if (std instanceof stream && std.readable) {
                    return std;
                } else if (typeof(std) === 'string') {
                    if (std === 'stdin') {
        Severity: Minor
        Found in lib/templatefy.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

        Severity
        Category
        Status
        Source
        Language