oleksiyk/riakfs

View on GitHub

Showing 75 of 75 total issues

File index.js has 1630 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

var path    = require('path');
var _       = require('lodash');
var Promise = require('bluebird');
Severity: Major
Found in lib/index.js - About 4 days to fix

    Function open has 180 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    RiakFs.prototype.open = function (_filename, flags, mode, callback) {
        var self = this;
    
        function _open() {
            var d, p = Promise.resolve({ isDirectory: true }), options = {};
    Severity: Major
    Found in lib/index.js - About 7 hrs to fix

      Function _open has 168 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _open() {
              var d, p = Promise.resolve({ isDirectory: true }), options = {};
      
              if (typeof _filename === 'object') {
                  options = _filename;
      Severity: Major
      Found in lib/index.js - About 6 hrs to fix

        Function _rename has 155 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        RiakFs.prototype._rename = function (_old, _new, options) {
            var self = this, file, vclock;
        
            return Promise.all([
                self.riak.get({
        Severity: Major
        Found in lib/index.js - About 6 hrs to fix

          Function share has 154 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          RiakFs.prototype.share = function (_path, root, alias, readOnly, callback) {
              var self = this, dstPath = '/Shared/' + alias, p = Promise.resolve(), _p;
          
              _path = _normalizePath(_path);
          
          
          Severity: Major
          Found in lib/index.js - About 6 hrs to fix

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

                        return Promise.all([
                            _tfs.riak.get({
                                bucket: _tfs.filesBucket,
                                key: dstPath,
                                type: _tfs.options.metaType
            Severity: Major
            Found in lib/index.js and 1 other location - About 4 hrs to fix
            lib/index.js on lines 374..421

            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 116.

            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

                    return Promise.all([
                        fs.riak.get({
                            bucket: fs.filesBucket,
                            key: _path,
                            type: fs.options.metaType
            Severity: Major
            Found in lib/index.js and 1 other location - About 4 hrs to fix
            lib/index.js on lines 1608..1656

            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 116.

            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 unshare has 95 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            RiakFs.prototype.unshare = function (__path, root, callback) {
                var dir;
                if (typeof root === 'function') {
                    callback = root;
                }
            Severity: Major
            Found in lib/index.js - About 3 hrs to fix

              Function mkdir has 90 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              RiakFs.prototype.mkdir = function (__path, mode, callback) {
                  var self = this, options = {};
              
                  if (typeof mode === 'function') {
                      callback = mode;
              Severity: Major
              Found in lib/index.js - About 3 hrs to fix

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

                                return fs.riak.put({
                                    bucket: fs.filesBucket,
                                    key: _path,
                                    vclock: reply.vclock,
                                    content: {
                Severity: Major
                Found in lib/index.js and 1 other location - About 3 hrs to fix
                lib/index.js on lines 1675..1695

                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 96.

                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

                            return self.riak.put({
                                bucket: self.filesBucket,
                                key: _path,
                                vclock: sreply.vclock,
                                content: {
                Severity: Major
                Found in lib/index.js and 1 other location - About 3 hrs to fix
                lib/index.js on lines 1750..1767

                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 96.

                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 unlink has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                RiakFs.prototype.unlink = function (_filename, callback) {
                    var self = this, file, options = {};
                
                    if (typeof _filename === 'object') {
                        options = _filename;
                Severity: Major
                Found in lib/index.js - About 3 hrs to fix

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

                  RiakFs.prototype.rename = function (_oldName, _newName, callback) {
                      var self = this, options = {};
                  
                      if (typeof _oldName === 'object') {
                          options = _oldName;
                  Severity: Major
                  Found in lib/index.js - About 2 hrs to fix

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

                        if (mtime !== null) {
                            if (typeof mtime === 'number') {
                                mtime = new Date(mtime);
                            }
                    
                    
                    Severity: Major
                    Found in lib/index.js and 1 other location - About 2 hrs to fix
                    lib/index.js on lines 1294..1303

                    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 93.

                    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

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

                                    return _tfs.riak.put({
                                        bucket: _tfs.filesBucket,
                                        key: dstPath,
                                        vclock: dreply.vclock,
                                        content: {
                    Severity: Major
                    Found in lib/index.js and 1 other location - About 2 hrs to fix
                    lib/index.js on lines 915..927

                    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 93.

                    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

                        if (atime !== null) {
                            if (typeof atime === 'number') {
                                atime = new Date(atime);
                            }
                    
                    
                    Severity: Major
                    Found in lib/index.js and 1 other location - About 2 hrs to fix
                    lib/index.js on lines 1305..1315

                    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 93.

                    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

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

                                                return _tfs.riak.put({
                                                    bucket: _tfs.filesBucket,
                                                    key: dstPath,
                                                    vclock: dreply.vclock,
                                                    content: {
                    Severity: Major
                    Found in lib/index.js and 1 other location - About 2 hrs to fix
                    lib/index.js on lines 1643..1655

                    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 93.

                    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

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

                        if (!fd.chunk || fd.chunk.n !== n) {
                            fd.chunk = new Chunk(fd.file, n, fd.fs);
                            p = fd.chunk.load();
                        } else {
                            p = Promise.resolve();
                    Severity: Major
                    Found in lib/index.js and 1 other location - About 2 hrs to fix
                    lib/index.js on lines 812..817

                    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 90.

                    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

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

                        if (!fd.chunk || fd.chunk.n !== n) {
                            fd.chunk = new Chunk(fd.file, n, fd.fs);
                            p = fd.chunk.load();
                        } else {
                            p = Promise.resolve();
                    Severity: Major
                    Found in lib/index.js and 1 other location - About 2 hrs to fix
                    lib/index.js on lines 741..746

                    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 90.

                    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 _mkdir has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function _mkdir() {
                            return self._readLink(__path).spread(function (fs, _path, readOnly) {
                                var d = path.dirname(_path), p = Promise.resolve(true);
                    
                                if (_path === '/') {
                    Severity: Major
                    Found in lib/index.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language