core/js/oc-backbone-webdav.js
File oc-backbone-webdav.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Copyright (c) 2015
*
* This file is licensed under the Affero General Public License version 3
* or later.
Function davSync
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function davSync(method, model, options) {
var params = {type: getTypeForMethod(method, model)};
var isCollection = (model instanceof Backbone.Collection);
// Ensure that we have a URL.
Function callMethod
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function callMethod(client, options, model, headers) {
var data = options.data;
if (_.isObject(data)) {
headers['Content-Type'] = 'application/json';
data = JSON.stringify(data);
Function callPropPatch
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function callPropPatch(client, options, model, headers) {
var changes = model.changed;
if (options.wait && _.isEmpty(changes)) {
// usually with "wait" mode, the changes aren't set yet,
changes = options.data;
Function getTypeForMethod
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getTypeForMethod(method, model) {
var type = methodMap[method];
if (!type) {
// return method directly
Consider simplifying this complex logical expression. Open
Open
if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {
params.data = options.attrs || model.toJSON(options);
}