Showing 107 of 108 total issues
Function handleAction
has 242 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleAction(action) {
switch (action.type) {
case userActionTypes.ORG_USERS_FETCH: {
this.loadingRequests.entityUsers = true;
break;
File cf_api.js
has 552 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import http from "axios";
import queryString from "query-string";
import { noticeError } from "../util/analytics.js";
import domainActions from "../actions/domain_actions.js";
`` has 63 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default {
version: APIV,
formatSplitResponse(resource) {
return Object.assign({}, resource.entity, resource.metadata);
Function handleAction
has 198 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleAction(action) {
switch (action.type) {
case serviceActionTypes.SERVICE_INSTANCES_FETCH: {
this.isFetchingAll = true;
this.emitChange();
Function handleAction
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleAction(action) {
switch (action.type) {
case routeActionTypes.ROUTES_RECEIVED: {
const routes = action.routes;
this.mergeRoutes(routes);
File user_actions.js
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Actions for user entities. Any actions such as fetching, creating, updating,
* etc should go here.
*/
File user_store.js
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Store for user data. Will store and update user data on changes from UI and
* server.
*/
userActions
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
Open
const userActions = {
fetchOrgUsers(orgGuid) {
AppDispatcher.handleViewAction({
type: userActionTypes.ORG_USERS_FETCH,
orgGuid
Function handleAction
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleAction(action) {
switch (action.type) {
case appActionTypes.APP_FETCH:
this.isFetchingApp = true;
this.emitChange();
Function render
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const route = this.props.route;
const domains = this.props.domains;
const routeLimit = this.props.routeLimit;
let limit;
File service_instance_store.js
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Store for services data. Will store and update services data on changes from
* UI and server.
*/
import AppDispatcher from "../dispatcher";
Function handleAction
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleAction(action) {
switch (action.type) {
case orgActionTypes.ORG_FETCH: {
this.isFetchingOrg = true;
this.emitChange();
serviceActions
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
Open
const serviceActions = {
fetchAllServices(orgGuid) {
AppDispatcher.handleViewAction({
type: serviceActionTypes.SERVICES_FETCH,
orgGuid
File service_actions.js
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* Actions for service entities. Any actions such as fetching, creating,
* updating, etc should go here.
*/
Function handleAction
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
Open
handleAction(action) {
switch (action.type) {
case serviceActionTypes.SERVICE_INSTANCES_FETCH: {
this.isFetchingAll = true;
this.emitChange();
- 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 CreateExternalServerForPrivileged
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
Open
func CreateExternalServerForPrivileged(t *testing.T, test BasicProxyTest) *httptest.Server {
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
privilegedToken := "90d64460d14870c08c81352a05dedd3465940a7c"
if r.URL.String() == "/oauth/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 formContent
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get formContent() {
const serviceName = this.serviceName;
if (CF_CLI_SERVICE_DETAILS.hasOwnProperty(serviceName)) {
return (
<Form
Function render
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
let buttonText;
let content = (
<div>
<Loading text="Loading users" />
Function reduce
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reduce(action) {
switch (action.type) {
case upsiActionTypes.UPSI_FETCH_ALL_REQUEST: {
this.allRequest = {
...this.allRequest,
Function render
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {
org,
space,
app,