Samisdat/not-fs

View on GitHub

Showing 135 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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        Permission.prototype.isExecutable = function(isOwner, isOwnerGroupMember){
        
            var part = this._getPart(isOwner, isOwnerGroupMember);
        
            if ('7' === part){
        Severity: Major
        Found in lib/unreal-filesystem/permission.js and 2 other locations - About 3 hrs to fix
        lib/unreal-filesystem/permission.js on lines 73..94
        lib/unreal-filesystem/permission.js on lines 96..117

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 97.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        Permission.prototype.isWritable = function(isOwner, isOwnerGroupMember){
        
            var part = this._getPart(isOwner, isOwnerGroupMember);
        
            if ('7' === part){
        Severity: Major
        Found in lib/unreal-filesystem/permission.js and 2 other locations - About 3 hrs to fix
        lib/unreal-filesystem/permission.js on lines 73..94
        lib/unreal-filesystem/permission.js on lines 119..140

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 97.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        Permission.prototype.isReadable = function(isOwner, isOwnerGroupMember){
        
            var part = this._getPart(isOwner, isOwnerGroupMember);
        
            if ('7' === part){
        Severity: Major
        Found in lib/unreal-filesystem/permission.js and 2 other locations - About 3 hrs to fix
        lib/unreal-filesystem/permission.js on lines 96..117
        lib/unreal-filesystem/permission.js on lines 119..140

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 97.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          unrealFs.swapOut = function(){
              for (var method in fs){
                  if (undefined !== unrealFs[method] && true === whitelist[method]){
                      fs[method] = orginal[method].bind(this);
                  }
          Severity: Major
          Found in lib/unreal.js and 1 other location - About 2 hrs to fix
          lib/unreal.js on lines 91..99

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 79.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          unrealFs.swapIn = function(){
          
              for (var method in fs){
                  if (undefined !== unrealFs[method] && true === whitelist[method]){
                      fs[method] = unrealFs[method].bind(this);
          Severity: Major
          Found in lib/unreal.js and 1 other location - About 2 hrs to fix
          lib/unreal.js on lines 101..108

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 79.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          Tree.prototype.removeFile = function(filePath){
          
              if (false === this.exists(filePath)){
                  return;
              }
          Severity: Major
          Found in lib/unreal-filesystem/tree.js and 1 other location - About 1 hr to fix
          lib/unreal-filesystem/tree.js on lines 397..406

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 67.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          Tree.prototype.remove = function(filePath){
          
              if (false === this.exists(filePath)){
                  return;
              }
          Severity: Major
          Found in lib/unreal-filesystem/tree.js and 1 other location - About 1 hr to fix
          lib/unreal-filesystem/tree.js on lines 387..395

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 67.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              if (false === this.exists(parentDirPath)){
          
                  if (true !== addMissingDirs){
                      throw new Error('can not create ' + dirPath + ' while parent ' + parentDirPath + ' is not existing');
                  }
          Severity: Major
          Found in lib/unreal-filesystem/tree.js and 2 other locations - About 1 hr to fix
          lib/unreal-filesystem/tree.js on lines 223..229
          lib/unreal-filesystem/tree.js on lines 428..434

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 64.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              if (false === this.exists(parentDirOfNewPath)){
          
                  if (true !== addMissingDirs){
                      throw new Error('can not create ' + newPath + ' while parent ' + parentDirOfNewPath + ' is not existing');
                  }
          Severity: Major
          Found in lib/unreal-filesystem/tree.js and 2 other locations - About 1 hr to fix
          lib/unreal-filesystem/tree.js on lines 223..229
          lib/unreal-filesystem/tree.js on lines 349..355

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 64.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

              if (false === this.exists(parentDirPath)){
          
                  if (true !== addMissingDirs){
                      throw new Error('can not create ' + dirPath + ' while parent ' + parentDirPath + ' is not existing');
                  }
          Severity: Major
          Found in lib/unreal-filesystem/tree.js and 2 other locations - About 1 hr to fix
          lib/unreal-filesystem/tree.js on lines 349..355
          lib/unreal-filesystem/tree.js on lines 428..434

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 64.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          Node.prototype.isOwner = function(userId){
          
              if(undefined === userId){
                  userId = process.getuid()
              }
          Severity: Major
          Found in lib/unreal-filesystem/node.js and 1 other location - About 1 hr to fix
          lib/unreal-filesystem/node.js on lines 130..138

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

          Node.prototype.isInOwnerGroup = function(groupId){
          
              if(undefined === groupId){
                  groupId = process.getgid();
              }
          Severity: Major
          Found in lib/unreal-filesystem/node.js and 1 other location - About 1 hr to fix
          lib/unreal-filesystem/node.js on lines 121..128

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 57.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            Node.prototype.isReadable = function(userId, groupId){
            
                return this.permission.isReadable(
                    this.isOwner(userId),
                    this.isInOwnerGroup(groupId)
            Severity: Major
            Found in lib/unreal-filesystem/node.js and 2 other locations - About 55 mins to fix
            lib/unreal-filesystem/node.js on lines 149..156
            lib/unreal-filesystem/node.js on lines 158..165

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            Node.prototype.isWritable = function(userId, groupId){
            
                return this.permission.isWritable(
                    this.isOwner(userId),
                    this.isInOwnerGroup(groupId)
            Severity: Major
            Found in lib/unreal-filesystem/node.js and 2 other locations - About 55 mins to fix
            lib/unreal-filesystem/node.js on lines 140..147
            lib/unreal-filesystem/node.js on lines 158..165

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            Node.prototype.isExecutable = function(userId, groupId){
            
                return this.permission.isExecutable(
                    this.isOwner(userId),
                    this.isInOwnerGroup(groupId)
            Severity: Major
            Found in lib/unreal-filesystem/node.js and 2 other locations - About 55 mins to fix
            lib/unreal-filesystem/node.js on lines 140..147
            lib/unreal-filesystem/node.js on lines 149..156

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 54.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language