Showing 45 of 1,887 total issues
File switchery.js
has 919 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
;(function(){
/**
* Require the module at `name`.
Function exports
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app, conf = {}) => {
const AdminUtils = adminUtils(app);
const { baseUrl = 'admin' } = conf;
const { errors } = AdminUtils;
const { created } = app.handler;
Function select
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const select = (el) => {
const data = el.data();
const { ref, display, value, qtype, placeholder } = data;
const isMultiple = el.attr('multiple') === 'multiple';
const { sort = display } = data;
Function exports
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app) => {
const { Validate } = app.service('System');
const mongoose = app.service('Mongoose');
const Plugin = app.service('PluginService');
const ObjectId = mongoose.Schema.Types.ObjectId;
Function FastClick
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function FastClick(layer) {
'use strict';
var oldOnClick, self = this;
Function Admin
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function Admin(app, config) {
const getConf = config || app.config('admin');
if (!getConf) {
return log('config not found!');
}
Function exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = (app, njk) => {
function FieldExtension() {
this.tags = ['field'];
this.parse = parse('field', this);
- 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 object
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
object(req, res, next) {
const { object, id: objectId } = req.params;
const body = _.omit(req.body, _.isEmpty);
let modelData;
Function onTouchEnd
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FastClick.prototype.onTouchEnd = function(event) {
'use strict';
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) {
Function exports
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app, njk) => {
const AdminUtils = adminUtils(app);
function PaginateExtension() {
this.tags = ['paginate'];
Function exports
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app, conf = {}) => {
const AdminUtils = adminUtils(app);
const { baseUrl = 'admin' } = conf;
const { errors } = AdminUtils;
const { created } = app.handler;
Function select2nested
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
const select2nested = (data, valueField, displayField, isMultiple, prefix, initPrefix = '-') => {
let r = [];
let getPrefix = prefix;
if (!getPrefix) {
getPrefix = isMultiple ? '' : `${initPrefix} `;
- 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 PaginateExtension
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function PaginateExtension() {
this.tags = ['paginate'];
this.parse = parse('paginate', this);
this.run = (context, params = {}, q = {}, options = {}, body, errorBody, cb) => {
Function exports
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app, conf = {}, viewsPath, router) => {
const env = app.get('env');
const {
baseUrl = 'admin',
Function exports
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app, njk) => {
const AdminUtils = adminUtils(app);
function ApiQueryExtension() {
this.tags = ['apiquery'];
Function run
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.run = (context, params = {}, q = {}, options = {}, body, errorBody, cb) => {
const { object, querymen = {} } = context.ctx;
const { model, name, pageBaseUrl } = params;
let { page = 1, limit = 10, sort, populate = [] } = options;
const queryName = name || object;
Function exports
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app, njk) => {
function FieldExtension() {
this.tags = ['field'];
this.parse = parse('field', this);
Function onInitialize
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onInitialize() {
const self = this;
const q = { limit: 100, sort };
if (qtype === 'fullArrayTree') {
Function ApiQueryExtension
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ApiQueryExtension() {
this.tags = ['apiquery'];
this.parse = parse('apiquery', this);
this.run = (context, params = {}, q = {}, options = {}, body, errorBody, cb) => {
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app) => {
const { models, baseUrl = 'admin' } = app.config('admin');
const { cookie = 'locale' } = app.config('i18n');
const { unprocessableEntity, notFound, internalServerError } = app.handler;
const getModel = object => app.service('Mongoose').model(object);