kelsin/kapit

View on GitHub

Showing 10 of 18 total issues

File kapit.js has 401 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var _ = require('lodash');
var blessed = require('blessed');

Severity: Minor
Found in lib/kapit.js - About 5 hrs to fix

    Function response has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.response = function(step) {
      var output = '';
    
      if(data.raw()) {
        var outputStep = _.cloneDeep(step);
    Severity: Minor
    Found in lib/render.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 request has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.request = function(step) {
      var output = '';
    
      if (step.type === 'HTTP' && !data.raw()) {
        output += '{green-fg}Name{/}: ' + step.name;
    Severity: Minor
    Found in lib/render.js - About 1 hr to fix

      Function help has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.help = function() {
        var output = '';
      
        output += '{yellow-fg}Focused Element{/}';
        output += '\n {green-fg}j{/} move down a line';
      Severity: Minor
      Found in lib/render.js - About 1 hr to fix

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

        exports.response = function(step) {
          var output = '';
        
          if(data.raw()) {
            var outputStep = _.cloneDeep(step);
        Severity: Minor
        Found in lib/render.js - About 1 hr to fix

          Function modal has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          exports.modal = function(text, options) {
            return blessed.box(_.merge({
              padding: {
                left: 1,
                right: 1
          Severity: Minor
          Found in lib/widgets.js - About 1 hr to fix

            Function request has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

            exports.request = function(step) {
              var output = '';
            
              if (step.type === 'HTTP' && !data.raw()) {
                output += '{green-fg}Name{/}: ' + step.name;
            Severity: Minor
            Found in lib/render.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 input has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.input = function(text, options) {
              return blessed.Textbox(_.merge({
                padding: {
                  left: 1,
                  right: 1
            Severity: Minor
            Found in lib/widgets.js - About 1 hr to fix

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

              exports.chain = function() {
                return _(data.getCurrentSteps()).map(function(step, index) {
                  var color = '';
              
                  if(index === data.getCurrentChain().current) {
              Severity: Minor
              Found in lib/render.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 http has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              exports.http = function(request, label) {
                var output = '';
              
                if (request) {
                  output += '\n';
              Severity: Minor
              Found in lib/render.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