DarkoKukovec/crypto-fs

View on GitHub

Showing 6 of 6 total issues

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

module.exports = function() {
  return {
    readAsync: function(fn) {
      return function(file) {
        config.check();
Severity: Major
Found in lib/utils/wrappers.js - About 3 hrs to fix

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

    function expandPathSync(linkPath) {
      var prevPath;
      do {
        prevPath = linkPath
        // TODO: Find a better way to determine if linkPath is inside of config.root
    Severity: Minor
    Found in lib/utils/readlink.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 processBuffer has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function processBuffer(data, key, cipherMethod, inputEncoding, outputEncoding) {
    Severity: Minor
    Found in lib/utils/crypto.js - About 35 mins to fix

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

      module.exports = function(options) {
        if (!options) {
          throw new Error('Options missing');
        }
        var fs = options.baseFs || config.baseFs;
      Severity: Minor
      Found in lib/init.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 exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function(fs) {
        return function(file, newFile, cb) {
          fs.readFile(file, function(err, data) {
            if (err) {
              return cb(err, null);
      Severity: Minor
      Found in lib/async/rename.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 exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = function(fs) {
        return function(file, appendData, options) {
          if (helpers.existsSync(fs, file)) {
            var data = fs.readFileSync(file);
            var dataBuffer = appendData instanceof Buffer ? appendData : new Buffer(appendData);
      Severity: Minor
      Found in lib/sync/appendFile.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