Showing 1,111 of 1,370 total issues
Function initialise
has a Cognitive Complexity of 38 (exceeds 8 allowed). Consider refactoring. Open
private initialise() {
this.globalActions = this.setupActionsDefaultObservables(
this.config.getGlobalActions()
);
this.multiActions = this.setupActionsDefaultObservables(
- 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
File cf.helpers.ts
has 380 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
import { combineLatest, Observable } from 'rxjs';
import { filter, first, map, publishReplay, refCount, switchMap, tap } from 'rxjs/operators';
Function main
has a Cognitive Complexity of 37 (exceeds 8 allowed). Consider refactoring. Open
func main() {
// Register time.Time in gob
gob.Register(time.Time{})
- 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 portalProxy.ProxyRequest
has a Cognitive Complexity of 37 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) ProxyRequest(c echo.Context, uri *url.URL) (map[string]*interfaces.CNSIRequest, error) {
log.Debug("ProxyRequest")
cnsiList := strings.Split(c.Request().Header.Get("x-cap-cnsi-list"), ",")
shouldPassthrough := "true" == c.Request().Header.Get("x-cap-passthrough")
longRunning := "true" == c.Request().Header.Get(longRunningTimeoutHeader)
- 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 getDefaultInitialTestStoreState
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDefaultInitialTestStoreState(): AppState<BaseEntityValues> {
return {
...getDefaultInitialTestStratosStoreState(),
pagination: {
system: {},
File entity-service.spec.ts
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { HttpClientModule, HttpRequest, HttpXhrBackend } from '@angular/common/http';
import { HttpTestingController } from '@angular/common/http/testing';
import { inject, TestBed } from '@angular/core/testing';
import { Action, Store } from '@ngrx/store';
import { filter, first, map, pairwise, tap } from 'rxjs/operators';
File cf-shared.module.ts
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { CommonModule } from '@angular/common';
import { ApplicationModule, NgModule, Type } from '@angular/core';
import { MaterialDesignFrameworkModule } from '@cfstratos/ajsf-material';
import { CoreModule } from '../../../core/src/core/core.module';
Method portalProxy.buildCNSIList
has a Cognitive Complexity of 35 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) buildCNSIList(c echo.Context) ([]*interfaces.CNSIRecord, error) {
log.Debug("buildCNSIList")
if p.GetConfig().UserEndpointsEnabled != config.UserEndpointsConfigEnum.Disabled {
userID, err := p.GetSessionValue(c, "user_id")
- 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
Identical blocks of code found in 2 locations. Consider refactoring. Open
for rows.Next() {
var (
pCNSIType string
pURL string
cipherTextClientSecret []byte
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 348.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
for rows.Next() {
var (
pCNSIType string
pURL string
cipherTextClientSecret []byte
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 348.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File schema-tree-traverse.spec.ts
has 357 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { RecursiveDelete } from '../effects/recursive-entity-delete.effect';
import { EntitySchema } from './entity-schema';
import { EntitySchemaTreeBuilder, IFlatTreeValue } from './schema-tree-traverse';
describe('SchemaTreeTraversal', () => {
File cf-api.types.ts
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { APIResource } from '../../store/src/types/api.types';
import { IService, IServiceBinding } from './cf-api-svc.types';
import { CfUser } from './store/types/cf-user.types';
export interface StratosCFEntity {
Function StratosSpecReporter
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
var StratosSpecReporter = function (baseReporterDecorator, config) {
baseReporterDecorator(this);
const reporterConfig = Object.assign({}, config.stratosReporter);
this.file = reporterConfig.reportFile || './stratos-test-report.log';
Function createPodExpandedStatus
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
static createPodExpandedStatus(pod: KubernetesPod): KubernetesPodExpandedStatus {
let restarts = 0;
const totalContainers = pod.spec.containers ? pod.spec.containers.length : 0;
let readyContainers = 0;
Similar blocks of code found in 2 locations. Consider refactoring. Open
func (p *PgsqlLocalUsersRepository) AddLocalUser(user interfaces.LocalUser) error {
log.Debug("AddLocalUser")
//Validate args
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 424.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
func (p *PgsqlLocalUsersRepository) UpdateLocalUser(user interfaces.LocalUser) error {
log.Debug("UpdateLocalUser")
//Validate args
var err error
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 424.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File kubernetes.actions.ts
has 337 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { SortDirection } from '@angular/material/sort';
import { Action } from '@ngrx/store';
import { getActions } from 'frontend/packages/store/src/actions/action.helper';
import { ApiRequestTypes } from 'frontend/packages/store/src/reducers/api-request-reducer/request-helpers';
Method HelmRelease.parseManifest
has a Cognitive Complexity of 31 (exceeds 8 allowed). Consider refactoring. Open
func (r *HelmRelease) parseManifest() {
r.ManifestErrors = false
reader := bytes.NewReader([]byte(r.Manifest))
buffer := bufio.NewReader(reader)
var bufr strings.Builder
- 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 get
has a Cognitive Complexity of 31 (exceeds 8 allowed). Consider refactoring. Open
get(summary: any, appInstances: AppStat[]): ApplicationStateData {
const appState: string = summary ? summary.state : 'UNKNOWN';
const pkgState = this.getPackageState(appState, summary);
const wildcard = this.stateMetadata['?'];
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
export class CFEndpointsListConfigService implements IListConfig<EndpointModel> {
columns: ITableColumn<EndpointModel>[];
isLocal = true;
dataSource: CFEndpointsDataSource;
viewType = ListViewTypes.CARD_ONLY;
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 271.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76