Showing 10 of 10 total issues
Function exports
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (config) { if (process.env.CI && (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY)) { throw ConfigException('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.') }
Function diff
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function diff(objOld, objNew) { // jshint maxdepth:3 let result = {}; for (let key of Object.keys(objNew)) { let valueOld = (objOld) ? objOld[key] : null,
- Read upRead up
Similar blocks of code found in 3 locations. Consider refactoring. Open
patch(path = '', data = {}, query = {}) { let uri = URI.build({'path': path, 'query': URI.buildQuery(query)}); return this.request('patch', uri, data); }
- Read upRead up
Similar blocks of code found in 3 locations. Consider refactoring. Open
put(path = '', data = {}, query = {}) { let uri = URI.build({'path': path, 'query': URI.buildQuery(query)}); return this.request('put', uri, data); }
- Read upRead up
Similar blocks of code found in 3 locations. Consider refactoring. Open
post(path = '', data = {}, query = {}) { let uri = URI.build({'path': path, 'query': URI.buildQuery(query)}); return this.request('post', uri, data); }
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
next() { if (typeof this.responseData.next !== 'string') { return Promise.resolve(this); }
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
previous() { if (typeof this.responseData.previous !== 'string') { return Promise.resolve(this); }
- Read upRead up
Function diff
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function diff(objOld, objNew) { // jshint maxdepth:3 let result = {}; for (let key of Object.keys(objNew)) { let valueOld = (objOld) ? objOld[key] : null,
Similar blocks of code found in 2 locations. Consider refactoring. Open
else if (isObject(valueNew)) { let objDiff = diff(valueOld, valueNew); // No items in object (inital value), discard this key. if (!Object.keys(objDiff).length) {
- Read upRead up
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (Array.isArray(valueNew)) { let objDiff = diff(valueNew, valueOld); // No items in object (inital value), discard this key. if (!Object.keys(objDiff).length) {
- Read upRead up