Showing 66 of 178 total issues
File logTypes.js
has 659 lines of code (exceeds 250 allowed). Consider refactoring. Open
export default {
s: {
event: 'Success Login',
icon: {
name: '312',
File users.js
has 464 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash';
import auth0 from 'auth0';
import request from 'request';
import Promise from 'bluebird';
import { Router } from 'express';
File user.js
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
import axios from 'axios';
import { push } from 'react-router-redux';
import * as constants from '../constants';
import { fetchUserLogs } from './userLog';
Function render
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const code = this.state.code;
const scripts = this.props.scripts.toJS();
const { languageDictionary, settings } = this.props;
const originalTitle = (settings.dict && settings.dict.title) || window.config.TITLE || 'User Management';
Function getListFields
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
getListFields(props) {
const { userFields } = props;
const defaultListFields = [
{
listOrder: 0,
Function render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { user, databaseConnections, log, logs, devices, settings, languageDictionary } = this.props;
const userFields = (settings && settings.userFields) || [];
const allowedUserFields = userFields.filter(field => field.property !== 'picture' && field.property !== 'client');
const suppressRawData = settings && settings.suppressRawData === true;
Function render
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { user, error, loading, memberships, settings } = this.props;
const languageDictionary = this.props.languageDictionary || {};
const labels = languageDictionary.labels || {};
Function render
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { users, loading, sortProperty, sortOrder } = this.props;
const languageDictionary = this.props.languageDictionary || {};
const labels = languageDictionary.labels || {};
Function render
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
loading,
error,
users,
UserActions
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
export default class UserActions extends Component {
static propTypes = {
blockUser: PropTypes.func.isRequired,
changeEmail: PropTypes.func.isRequired,
changePassword: PropTypes.func.isRequired,
Function getListFields
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
getListFields(props) {
const { userFields } = props;
const defaultListFields = [
{
listOrder: 0,
- 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 render
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
render() {
const code = this.state.code;
const scripts = this.props.scripts.toJS();
const { languageDictionary, settings } = this.props;
const originalTitle = (settings.dict && settings.dict.title) || window.config.TITLE || 'User Management';
- 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 render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { loading, sortProperty, sortOrder, error, settings } = this.props;
const languageDictionary = this.props.languageDictionary || {};
const labels = languageDictionary.labels || {};
const searchOptions = this.searchOptions.map((option) => {
Function processTokens
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
const processTokens = (dispatch, apiToken, returnTo) => {
return new Promise((resolve, reject) => {
// check token expiration date
const decodedToken = jwtDecode(apiToken);
if (isTokenExpired(decodedToken)) {
File UserActions.jsx
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { MenuItem, DropdownButton } from 'react-bootstrap';
import _ from 'lodash';
import { removeBlockedIPs } from "../../reducers/removeBlockedIPs";
Function getFieldByComponentName
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
getFieldByComponentName(field, componentName) {
const validate = (field.required || field.validationFunction) ? [] : undefined;
if (field.required) validate.push(requiredValidationFunction(this.props.languageDictionary || {}));
if (field.validationFunction) {
validate.push((value, values, context) => field.validationFunction(value, values, context, this.props.languageDictionary || {}));
- 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 checkCustomFieldValidation
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const checkCustomFieldValidation = (req, context, isEditRequest, onlyTheseFields) => {
/* Exit early if no custom fields */
if (!context.userFields) return context.payload;
const requiredErrorText = (req.query && req.query.requiredErrorText) || 'required';
Function default
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(client, entity, opts = {}, fetchOptions = {} ) {
const perPage = fetchOptions.perPage || 50;
const concurrency = fetchOptions.concurrency || 5;
const limit = fetchOptions.limit || null;
Function default
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export default function(client, entity, opts = {}, fetchOptions = {} ) {
const perPage = fetchOptions.perPage || 50;
const concurrency = fetchOptions.concurrency || 5;
const limit = fetchOptions.limit || null;
- 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 getFieldByComponentName
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
getFieldByComponentName(field, componentName) {
const validate = (field.required || field.validationFunction) ? [] : undefined;
if (field.required) validate.push(requiredValidationFunction(this.props.languageDictionary || {}));
if (field.validationFunction) {
validate.push((value, values, context) => field.validationFunction(value, values, context, this.props.languageDictionary || {}));