mjackson/bufferedstream

View on GitHub

Showing 6 of 6 total issues

Function pipe has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  pipe: d(function (dest, options) {
    var source = this;

    function ondata(chunk) {
      if (dest.writable && false === dest.write(chunk))
Severity: Minor
Found in index.js - About 1 hr to fix

    Function flush has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    function flush(stream) {
      if (!stream._chunks)
        return;
    
      var chunk;
    Severity: Minor
    Found in index.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 pipe has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      pipe: d(function (dest, options) {
        var source = this;
    
        function ondata(chunk) {
          if (dest.writable && false === dest.write(chunk))
    Severity: Minor
    Found in index.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 BufferedStream has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function BufferedStream(maxSize, source, sourceEncoding) {
      if (!(this instanceof BufferedStream))
        return new BufferedStream(maxSize, source, sourceEncoding);
    
      BaseClass.call(this);
    Severity: Minor
    Found in index.js - About 1 hr to fix

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

      function BufferedStream(maxSize, source, sourceEncoding) {
        if (!(this instanceof BufferedStream))
          return new BufferedStream(maxSize, source, sourceEncoding);
      
        BaseClass.call(this);
      Severity: Minor
      Found in index.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 flushSoon has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      function flushSoon(stream) {
        if (stream._flushing)
          return;
      
        stream._flushing = true;
      Severity: Minor
      Found in index.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