Showing 66 of 178 total issues
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { error, loading, settings } = this.props;
const languageDictionary = this.props.languageDictionary || {};
const suppressRawData = settings && settings.suppressRawData === true;
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { cancelPasswordChange, settings, connections } = this.props;
const { connection, user, error, requesting, loading } = this.props.passwordChange.toJS();
const userFields = settings.userFields || [];
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { cancelRemoveMultiFactor, settings } = this.props;
const { user, error, requesting, loading } = this.props.mfa.toJS();
const userFields = settings.userFields || [];
const languageDictionary = this.props.languageDictionary.get('record').toJS();
Function render
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { cancelPasswordReset, settings, connections } = this.props;
const { connection, user, error, requesting, loading } = this.props.passwordReset.toJS();
if (!requesting) {
Function render
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { cancelUsernameChange, connections, settings } = this.props;
const { user, connection, error, requesting, loading } = this.props.usernameChange.toJS();
if (!requesting) {
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
if (this.props.loading || this.props.error) {
return <div></div>;
}
Function RequireAuthentication
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function RequireAuthentication(InnerComponent) {
class RequireAuthenticationContainer extends React.Component {
static propTypes = {
push: PropTypes.func.isRequired,
auth: PropTypes.object.isRequired,
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { error, loading, settings } = this.props;
if (!error && this.props.logs.size === 0) {
return <div>There are no logs available for this user.</div>;
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
submitting,
customFields,
Function render
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { nextPage, pages } = this.props;
return (
<nav className="pull-right">
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { settingsLoading } = this.props;
const languageDictionary = this.props.languageDictionary ? this.props.languageDictionary.toJS() : {};
const settings = this.props.settings.get('settings') && this.props.settings.get('settings').toJS();
const renderCssToggle = !!(settings && settings.css && settings.altcss);
Function default
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function (cfg, storageProvider) {
config.setProvider(cfg);
const storage = storageProvider
? new tools.WebtaskStorageContext(storageProvider, { force: 1 })
Function getValue
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
export const getValue = (user, field, languageDictionary = {}, additionalData = {}) => {
if (!user || user.size === 0) {
return 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 render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { cancelEmailChange, settings, connections } = this.props;
const { user, connection, error, requesting, loading } = this.props.emailChange.toJS();
const userFields = settings.userFields || [];
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { log, logs, accessLevel, languageDictionary, settings } = this.props;
const originalTitle = (settings.dict && settings.dict.title) || window.config.TITLE || 'User Management';
document.title = `${languageDictionary.userLogsTabTitle || 'Logs'} - ${originalTitle}`;
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { user, issuer, accessLevel } = this.props;
const languageDictionary = this.props.languageDictionary || {};
const isAdmin = accessLevel.role === 3;
return (
Consider simplifying this complex logical expression. Open
Open
if (action && action.type.endsWith('_REJECTED') && action.payload) {
// Try to get the default error message from the response.
let message = action.payload.statusText || action.payload.status || 'Unknown Server Error';
const status = (action.payload.response && action.payload.response.status) || 500;
Function getMenu
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getMenu(isAdmin, languageDictionary) {
if (!isAdmin) {
return (
<ul role="menu" className="dropdown-menu">
{this.renderCssSwitcher(languageDictionary)}
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { error, loading, settings } = this.props;
if (loading) {
return <div></div>;
}
Function render
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const { error, loading, record } = this.props.userCreate.toJS();
const connections = this.props.connections.toJS();
const accessLevel = this.props.accessLevel.get('record').toJS();
const languageDictionary = this.props.languageDictionary.get('record').toJS();