Samisdat/not-fs

View on GitHub

Showing 15 of 135 total issues

Function statsGenerator has 129 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var statsGenerator = function(node) {

    var permission = node.permission;

    var stats = {
Severity: Major
Found in lib/unreal-filesystem/stats.js - About 5 hrs to fix

    File unreal-methods.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict';
    
    var unrealFs = {};
    
    var tree;
    Severity: Minor
    Found in lib/unreal-methods.js - About 4 hrs to fix

      File tree.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      var path = require('path');
      
      var Root = require('./root');
      Severity: Minor
      Found in lib/unreal-filesystem/tree.js - About 3 hrs to fix

        Function options has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var options = (function(defaults) {
        
            var user;
            var group;
        
        
        Severity: Major
        Found in lib/unreal-filesystem/options.js - About 2 hrs to fix

          Function rename has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Tree.prototype.rename = function(oldPath, newPath, addMissingDirs){
          
              addMissingDirs = (undefined === addMissingDirs) ? false : addMissingDirs;
          
              addMissingDirs = true;
          Severity: Minor
          Found in lib/unreal-filesystem/tree.js - About 1 hr to fix

            Function read has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            unrealFs.read = function(fd, buffer, offset, length, position, callback){
            Severity: Minor
            Found in lib/unreal-methods.js - About 45 mins to fix

              Function readSync has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              unrealFs.readSync = function(fd, buffer, offset, length, position){
              Severity: Minor
              Found in lib/unreal-methods.js - About 35 mins to fix

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

                Tree.prototype.createMissingDirs = function(dirPath){
                
                    var parts = dirPath.split(path.sep);
                
                    for (var i = 0, x = parts.length; i <= x; i += 1){
                Severity: Minor
                Found in lib/unreal-filesystem/tree.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 rename has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                Tree.prototype.rename = function(oldPath, newPath, addMissingDirs){
                
                    addMissingDirs = (undefined === addMissingDirs) ? false : addMissingDirs;
                
                    addMissingDirs = true;
                Severity: Minor
                Found in lib/unreal-filesystem/tree.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

                Avoid too many return statements within this function.
                Open

                    return false;
                Severity: Major
                Found in lib/unreal-filesystem/permission.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return false;
                  Severity: Major
                  Found in lib/unreal-filesystem/permission.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return false;
                    Severity: Major
                    Found in lib/unreal-filesystem/permission.js - About 30 mins to fix

                      Function addDir has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      Tree.prototype.addDir = function(dirPath, addMissingDirs){
                      
                          if ('' === dirPath.trim()){
                              throw new Error('dirPath may not be empty');
                          }
                      Severity: Minor
                      Found in lib/unreal-filesystem/tree.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

                      Function getPathByInodeNumber has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      Tree.prototype.getPathByInodeNumber = function(checkInodeNumber) {
                      
                          var parts = [];
                      
                          var tree = this;
                      Severity: Minor
                      Found in lib/unreal-filesystem/tree.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

                      Function getInodeNumberByPath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      Tree.prototype.getInodeNumberByPath = function(pathName){
                      
                          var parsePath = path.parse(pathName);
                      
                          if (parsePath.root === parsePath.dir && pathName === parsePath.dir){
                      Severity: Minor
                      Found in lib/unreal-filesystem/tree.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