Showing 22 of 51 total issues
File evaporate.js
has 1897 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*Copyright (c) 2016, TT Labs, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Function signingVersion
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function signingVersion(awsRequest, l) {
var con = awsRequest.con;
function AwsSignature(request) {
this.request = request;
}
Function authorizationMethod
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function authorizationMethod(awsRequest) {
var fileUpload = awsRequest.fileUpload,
con = fileUpload.con,
request = awsRequest.request;
Function Evaporate
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var Evaporate = function (config) {
this.config = extend({
readableStreams: false,
readableStreamPartMethod: null,
bucket: null,
Function add
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Evaporate.prototype.add = function (file, pConfig) {
var self = this,
fileConfig;
return new Promise(function (resolve, reject) {
var c = extend(pConfig, {});
Function sendRequestToAWS
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SignedS3AWSRequest.prototype.sendRequestToAWS = function () {
var self = this;
return new Promise( function (resolve, reject) {
var xhr = new XMLHttpRequest();
self.currentXhr = xhr;
Function canonicalHeaders
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AwsSignatureV4.prototype.canonicalHeaders = function () {
var canonicalHeaders = [],
keys = [],
i;
Function authorize
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AuthorizationMethod.prototype.authorize = function () {
return new Promise(function (resolve, reject) {
var xhr = new XMLHttpRequest();
awsRequest.currentXhr = xhr;
Function validateEvaporateOptions
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Evaporate.prototype.validateEvaporateOptions = function () {
this.supported = !(
typeof File === 'undefined' ||
typeof Promise === 'undefined');
Function makeParts
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FileUpload.prototype.makeParts = function (firstPart) {
this.numParts = Math.ceil(this.sizeBytes / this.con.partSize) || 1; // issue #58
var partsDeferredPromises = [];
var self = this;
Function streamToArrayBuffer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
PutPart.prototype.streamToArrayBuffer = function (stream) {
return new Promise(function (resolve, reject) {
// stream is empty or ended
if (!stream.readable) { return resolve([]); }
Function consumeSlots
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FileUpload.prototype.consumeSlots = function () {
if (this.partsToUpload.length === 0) { return -1 }
if (this.partsToUpload.length !== this.partsInProcess.length &&
this.status === EVAPORATING) {
Function progessStats
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FileUpload.prototype.progessStats = function () {
// Adapted from https://github.com/fkjaekel
// https://github.com/TTLabs/EvaporateJS/issues/13
if (this.fileTotalBytesUploaded === 0) {
return {
Function canonicalQueryString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
AwsSignatureV4.prototype.canonicalQueryString = function () {
var qs = awsRequest.request.query_string || '',
search = uri([awsRequest.awsUrl, this.request.path, qs].join("")).search,
searchParts = search.length ? search.split('&') : [],
encoded = [],
Function getLocalTimeOffset
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Evaporate.getLocalTimeOffset = function (config) {
return new Promise(function (resolve, reject) {
if (typeof config.localTimeOffset === 'number') {
return resolve(config.localTimeOffset);
}
Method getSignatureKey
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
static byte[] getSignatureKey(String secretKey, String dateStamp, String regionName, String serviceName, String toSign) throws Exception {
Avoid too many return
statements within this function. Open
Open
return 'The browser\'s FileReader object does not support readAsArrayBuffer';
Avoid too many return
statements within this function. Open
Open
return 'Option awsSignatureVersion is 4 but computeContentMd5 is not enabled.';
Avoid too many return
statements within this function. Open
Open
return 'Option computeContentMd5 has been set but cryptoMd5Method is not defined.'
Avoid too many return
statements within this function. Open
Open
return "The AWS 'bucket' option must be present.";