Showing 22 of 60 total issues
Function render
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { application, loading, error, clients, connections } = this.props;
const applicationJSON = application.toJSON();
const initialValues = {
name: this.props.currentName || applicationJSON.name || applicationJSON.client,
Function render
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { applications, appId } = this.props;
const rowsTotal = Object.keys(applications).length;
let rowIndex = 0;
return (
Function render
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.props.loading) {
return <div />;
}
const types = [
Function makeRequest
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const makeRequest = (req, path, method, payload) =>
new Promise((resolve, reject) => getToken(req).then((token) => {
request(method, `https://${config('AUTH0_DOMAIN')}/api/v2/${path}`)
.query(method === 'GET' ? payload : {})
.send(method === 'GET' ? null : payload || {})
- 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 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { loading, error, clients, applications, showModalCreate, showModalDelete, appId, createError } = this.props;
const apps = this.state.apps.length != 0 ? this.state.apps : applications;
return (
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { user, issuer, onLogout, isAdmin } = this.props;
const allowAuthz = window.config.ALLOW_AUTHZ;
return (
<header className="dashboard-header">
Function loadCredentials
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function loadCredentials() {
return (dispatch) => {
const credentials = loadForAdmin() || loadForUser();
if (credentials) {
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { loading, clients, connections, error, showModal } = this.props;
if (loading || error) {
return <div />;
Function default
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (client, entity, opts = {}, perPage = 100, concurrency = 5) {
if (client === null || client === undefined) {
throw new ArgumentError('Must provide a auth0 client object.');
}
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { loading, error, applications } = this.props;
return (
<div>
Function default
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export default function (client, entity, opts = {}, perPage = 100, concurrency = 5) {
if (client === null || client === undefined) {
throw new ArgumentError('Must provide a auth0 client object.');
}
- 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 getGroupsForUser
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const getGroupsForUser = (userId) =>
new Promise((resolve, reject) =>
getAuthorizationTokenCached()
.then((token) => {
if (!token) {
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { applications } = this.props;
return (
<div>
{Object.keys(applications).map((key) => {
Function saveApplication
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const saveApplication = (id, body, storage) => new Promise((resolve, reject) => {
const data = {
name: body.name,
client: body.client,
enabled: body.enabled,
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.state = {
show: false
Function config
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const config = (key) => {
if (settings && settings[key]) {
return boolify(settings[key]);
}
- 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 RequireAuthentication
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function RequireAuthentication(InnerComponent) {
class RequireAuthenticationContainer extends React.Component {
componentWillMount() {
this.requireAuthentication();
}
- 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 getGroups
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const getGroups = () =>
new Promise((resolve, reject) =>
getAuthorizationTokenCached()
.then((token) => {
if (!token) {
- 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
Consider simplifying this complex logical expression. Open
if (action && action.type.endsWith('_REJECTED') && action.payload) {
let error = 'Unknown Server Error';
if (action.payload.code === 'ECONNABORTED') {
error = 'The connectioned timed out.';
} else if (action.payload.data && action.payload.data.error) {
Function default
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function (client, entity, opts = {}, perPage = 100, concurrency = 5) {