Showing 29 of 78 total issues
Function exports
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Performs static analysis on the code to check for common errors.
Function exports
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Performs static analysis on the code to check for common errors.
jshint: {
Function exports
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(onMoveEntryRequested, onGetMetadataRequested) {
describe('onMoveEntryRequested', function() {
it('should be able to move a file ', function(done) {
var source = 'dir11/11.txt';
var target = '11_moved.txt';
Function exports
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(fs, onDeleteEntryRequested, onGetMetadataRequested) {
describe('onDeleteEntryRequested', function() {
it('should remove an existing file', function(done) {
var statOptions = {
entryPath: '/1.txt'
Function exports
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Performs static analysis on the code to check for common errors.
Function exports
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(onReadFileRequested, onOpenFileRequested) {
describe('onReadFileRequested', function() {
it('should fail for files that have not been opened yet', function(done) {
var options = {
openRequestId: 1,
Function exports
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(onCopyEntryRequested, onGetMetadataRequested) {
describe('onCopyEntryRequested', function() {
it('should be able to copy files to locations that do not yet exist', function(done) {
var source = 'dir2/2.txt';
var target = '2_copied.txt';
Function exports
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(onWriteFileRequested, onReadFileRequested,
onOpenFileRequested) {
describe('onWriteFileRequested', function() {
it('should write the correct data to a new file', function(done) {
var id = 987;
Function exports
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(fs, onOpenFileRequested) {
describe('onOpenFileRequested', function() {
it('should allow attempts to create files', function(done) {
var options = {
filePath: '/new.txt',
Function request
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
WebDAVClient.prototype.request = function(verb, url, headers, data, responseType,
onSuccess, onError) {
var xhr = new XMLHttpRequest();
var processBody = function() {
- Read upRead up
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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(fs, onCloseFileRequested, onOpenFileRequested) {
describe('onCloseFileRequested', function() {
it('should reject attempts to close unopened files', function(done) {
var options = {
openRequestId: 123
Function exports
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(onGetMetadataRequested) {
describe('onGetMetadataRequested', function() {
it('should return the correct metadata object for files', function(done) {
var options = {
entryPath: '/1.txt'
Function onDeleteEntryRequested
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var onDeleteEntryRequested = function(options, onSuccess, onError) {
if (!options.entryPath) {
onError('INVALID_OPERATION');
return;
}
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(onReadDirectoryRequested) {
describe('onReadDirectoryRequested', function() {
it('should return the correct contents for the given directory',
function(done) {
var options = {
Function testFactory
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var testFactory = function(open, read, truncate) {
return function(file, id, length, expected) {
return function(done) {
var openOptions = {
filePath: file,
Function onGetMetadataRequested
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var onGetMetadataRequested = function(options, onSuccess, onError) {
// Remove the leading slash from the path -- this isn't used in S3 keys.
var path = options.entryPath.substring(1);
var metadata;
Function onTruncateRequested
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var onTruncateRequested = function(options, onSuccess, onError) {
// Strip the leading slash, since not used internally.
var path = options.filePath.substring(1);
var readParameters = s3fs.parameters({
Function request
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
WebDAVClient.prototype.request = function(verb, url, headers, data, responseType,
onSuccess, onError) {
var xhr = new XMLHttpRequest();
var processBody = function() {
Function onDeleteEntryRequested
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
var onDeleteEntryRequested = function(options, onSuccess, onError) {
if (!options.entryPath) {
onError('INVALID_OPERATION');
return;
}
- Read upRead up
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 onTruncateRequested
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var onTruncateRequested = function(options, onSuccess, onError) {
if (!options.filePath) {
onError('INVALID_OPERATION');
return;
}