Showing 107 of 108 total issues
Function spaceDeveloper
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
get spaceDeveloper() {
const org = this.props.org || {};
const space = this.props.space || {};
let content;
- 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 stateSetter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function stateSetter() {
const appGuid = AppStore.currentAppGuid;
const activity = ActivityStore.getAll()
.filter(item => {
if (item.activity_type === "log") {
- 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 appHealth
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function appHealth(app) {
if (!app) {
throw new Error("`app` must be provided.");
}
- 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 mapStoreToState
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function mapStoreToState() {
let route;
const { currentAppGuid } = AppStore;
const app = AppStore.get(currentAppGuid);
const envRequest = EnvStore.getEnvRequest(currentAppGuid);
- 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 parseError
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function parseError(resultOrError) {
if (resultOrError instanceof Error) {
// Leave it alone
return resultOrError;
}
- 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
Method Settings.InitSettings
has 6 return statements (exceeds 4 allowed). Open
func (s *Settings) InitSettings(envVars *env.VarSet) (retErr error) {
defer func() {
// While .MustString() is convenient in readability below, we'd prefer
// to convert this to an error for upstream callers.
if r := recover(); r != nil {
Consider simplifying this complex logical expression. Open
if (this.props.brief) {
const cliLink = config.docs.cli ? (
<a href={config.docs.cli}>command line interface (CLI)</a>
) : (
<span>Command line interface (CLI)</span>
Method UAAContext.InviteUserToOrg
has 6 return statements (exceeds 4 allowed). Open
func (c *UAAContext) InviteUserToOrg(rw web.ResponseWriter, req *web.Request) {
// parse the request
inviteUserToOrgRequest, err := c.ParseInviteUserToOrgReq(req.Request)
if err != nil {
err.writeTo(rw)
Function addUserRoles
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
addUserRoles(role, resource, userGuid, entityGuid, entityType) {
Method SecureContext.submitRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (c *SecureContext) submitRequest(rw http.ResponseWriter, req *http.Request, url string, client *http.Client, responseHandler ResponseHandler) {
Function PrepareExternalServerCall
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func PrepareExternalServerCall(t *testing.T, c *controllers.SecureContext, testServer *httptest.Server, fullURL string, test BasicProxyTest) (*httptest.ResponseRecorder, *http.Request, *web.Router) {
Function deleteUserRoles
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
deleteUserRoles(roles, apiKey, userGuid, entityGuid, entityType) {
Function CreateExternalServer
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
func CreateExternalServer(t *testing.T, test *BasicProxyTest) *httptest.Server {
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
foundHandler := false
for _, handler := range test.Handlers {
if r.URL.RequestURI() == handler.ExpectedPath && r.Method == handler.RequestMethod {
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
handleAction(action) {
switch (action.type) {
case appActionTypes.APP_FETCH:
this.isFetchingApp = 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 stateSetter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function stateSetter() {
const appGuid = AppStore.currentAppGuid;
const orgGuid = OrgStore.currentOrgGuid;
const spaceGuid = SpaceStore.currentSpaceGuid;
- 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
Method UAAContext.GetUAAUserByEmail
has 5 return statements (exceeds 4 allowed). Open
func (c *UAAContext) GetUAAUserByEmail(email string) (
userResponse GetUAAUserResponse, err *UaaError) {
// Per https://tools.ietf.org/html/rfc7644#section-3.4.2.2, the value format in a SCIM query is JSON format
emailJSONBytes, mErr := json.Marshal(email)
if mErr != nil {
Function merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
merge(mergeKey, dataToMerge, cb = defaultChangedCallback.bind(this)) {
const toMerge = Immutable.fromJS(dataToMerge);
const oldDataItem = this.storeData.find(
d => d.get(mergeKey) === toMerge.get(mergeKey)
);
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
let content = <div />;
const serviceInstance = this.props.serviceInstance;
if (serviceInstance) {
- 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
Avoid too many return
statements within this function. Open
return OPERATION_RUNNING;
Avoid too many return
statements within this function. Open
return entityHealth.unknown;