Showing 107 of 108 total issues
Function emptyState
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
get emptyState() {
let content;
let callout;
if (this.state.currentUserCanViewSpace) {
Function addUserRole
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
addUserRole(user, entityType, entityGuid, addedRole, cb) {
const updatedUser = user;
if (updatedUser) {
if (entityType === "space") {
if (!updatedUser.space_roles) updatedUser.space_roles = {};
- 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 handleAction
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
handleAction(action) {
switch (action.type) {
case userActionTypes.ORG_USERS_FETCH: {
this.loadingRequests.entityUsers = true;
break;
- 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 handleAction
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
handleAction(action) {
switch (action.type) {
case routeActionTypes.ROUTES_RECEIVED: {
const routes = action.routes;
this.mergeRoutes(routes);
- 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 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { instance } = this.props;
const { last_operation: lastOp } = instance;
const lastOpTime = lastOp.updated_at || lastOp.created_at;
const specialtdStyles = {
Function fetchAllInstances
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchAllInstances(spaceGuid) {
AppDispatcher.handleViewAction({
type: serviceActionTypes.SERVICE_INSTANCES_FETCH,
spaceGuid
});
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let content = <Loading text="Loading service instances" />;
if (this.state.empty) {
content = <h4 className="test-none_message">No service instances</h4>;
Function actions
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
get actions() {
let content;
if (this.props.serviceInstance.loading) {
content = (
Function handleAction
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleAction(action) {
switch (action.type) {
case errorActionTypes.NOTIFY: {
const err = Object.assign({}, action.err);
// Put this error at the top, since it is considered higher priority
Function userProvider
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const userProvider = Component => {
class UserProvider extends React.Component {
constructor(props) {
super(props);
Function handleAction
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleAction(action) {
switch (action.type) {
case quotaActionTypes.ORGS_QUOTAS_FETCH: {
this.load([cfApi.fetchOrgsQuotas()]);
this.emitChange();
Function deleteUserRole
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
deleteUserRole(user, entityType, entityGuid, deletedRole, cb) {
const updatedUser = user;
if (updatedUser) {
let roles;
if (entityType === "space") {
- 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 fetchAllPages
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchAllPages(url, ...args) {
let [data, action] = args;
if (typeof data === "function") {
action = data;
data = {};
Function exports
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
browsers: ["Chrome"],
frameworks: ["jasmine", "jasmine-matchers", "jasmine-sinon"],
Function memory
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
get memory() {
const memory = this.state.editing
? this.state.form.fields.memory.value
: this.props.app.memory;
const maxMemory = Math.floor(
Function eventContent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
get eventContent() {
const { domain, item, route } = this.props;
const itemType = item.type;
const metadata = item.metadata;
Function scale
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
get scale() {
const instanceCount = this.state.editing
? this.state.form.fields.instances.value
: this.props.app.instances;
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let removeHandler;
if (this.isOrganization) {
removeHandler = this.handleRemoveUser;
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const err = this.props.err;
const link = config.docs.status && (
<span>
{" "}
Function render
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
let error;
if (this.state.err) {
error = <FormError message={this.state.err.message} />;