Showing 1,395 of 1,395 total issues
Function ngOnInit
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit() {
const defaultGetCellConfig = () => ({
entityKey: this.entityKey,
schema: this.schema,
monitorState: this.monitorState,
File autoscaler-util.ts
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment-timezone';
import {
AppAutoscalerMetricDataPoint,
AppAutoscalerMetricLegend,
Method portalProxy.ProxyRequest
has 78 lines of code (exceeds 50 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)
Method portalProxy.DoLoginToCNSI
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *portalProxy) DoLoginToCNSI(c echo.Context, cnsiGUID string, systemSharedToken bool) (*interfaces.LoginRes, error) {
cnsiRecord, err := p.GetCNSIRecord(cnsiGUID)
if err != nil {
return nil, interfaces.NewHTTPShadowError(
Method PgsqlTokenRepository.SaveCNSIToken
has 78 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (p *PgsqlTokenRepository) SaveCNSIToken(cnsiGUID string, userGUID string, tr interfaces.TokenRecord, encryptionKey []byte) error {
log.Debug("SaveCNSIToken")
if cnsiGUID == "" {
msg := "Unable to save CNSI Token without a valid CNSI GUID."
log.Debug(msg)
Function associateChildWithParent
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function associateChildWithParent(
store: Store<GeneralEntityAppState>,
action: EntityInlineChildAction,
apiResponse: APIResponse): Observable<boolean> {
let childValue;
Function constructor
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(
private store: Store<CFAppState>,
private cSIHelperServiceFactory: CreateServiceInstanceHelperServiceFactory,
private csiGuidsService: CsiGuidsService,
public modeService: CsiModeService,
Function createActionTableDate
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createActionTableDate(orgTarget, spaceTarget, stateIcon = '') {
const orgActions = [
{
user: userName,
action: 'remove_circle\nRemove',
Function getObservables
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getObservables<T = any>(
store: Store<GeneralEntityAppState>,
entityKey: string,
paginationKey: string,
paginationAction: PaginatedAction | PaginatedAction[],
File local-list-controller.spec.ts
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { getCurrentPageStartIndex, splitCurrentPage } from './local-list-controller.helpers';
describe('LocalListController', () => {
const page = [
[1,
Method MetricsSpecification.UpdateMetadata
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
func (m *MetricsSpecification) UpdateMetadata(info *interfaces.Info, userGUID string, echoContext echo.Context) {
metricsProviders := make([]MetricsMetadata, 0)
// Go through the metrics endpoints and get the corresponding services from the token metadata
if metrics, ok := info.Endpoints[EndpointType]; ok {
- 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 Analysis.checkStatus
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
func (c *Analysis) checkStatus() error {
log.Debug("Checking status....")
p := c.portalProxy
// Create a record in the reports datastore
dbStore, err := store.NewAnalysisDBStore(p.GetDatabaseConnection())
- 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 Monocular.artifactHubGetIcon
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
func (m *Monocular) artifactHubGetIcon(c echo.Context) error {
endpoint := c.Param("guid")
repo := c.Param("repo")
chartName := c.Param("name")
version := c.Param("version")
- 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 buildJSONResponse
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
func buildJSONResponse(cnsiList []string, responses map[string]*interfaces.CNSIRequest) map[string]*json.RawMessage {
log.Debug("buildJSONResponse")
jsonResponse := make(map[string]*json.RawMessage)
for _, guid := range cnsiList {
var response []byte
- 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.OAuthHandlerFunc
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) OAuthHandlerFunc(cnsiRequest *interfaces.CNSIRequest, req *http.Request, refreshOAuthTokenFunc interfaces.RefreshOAuthTokenFunc) interfaces.AuthHandlerFunc {
return func(tokenRec interfaces.TokenRecord, cnsi interfaces.CNSIRecord) (*http.Response, error) {
got401 := false
- 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.apiKeyMiddleware
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
func (p *portalProxy) apiKeyMiddleware(h echo.HandlerFunc) echo.HandlerFunc {
return func(c echo.Context) error {
log.Debug("apiKeyMiddleware")
// skipping thise middleware if API keys are disabled
- 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 init
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
func init() {
RegisterMigration(20170818120003, "InitialSchema", func(txn *sql.Tx, conf *goose.DBConf) error {
binaryDataType := "BYTEA"
if strings.Contains(conf.Driver.Name, "mysql") {
binaryDataType = "BLOB"
- 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 getUnvisit
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
var getUnvisit = function getUnvisit(entities) {
var cache = {};
var getEntity = getEntities(entities);
return function unvisit(input, schema) {
if (typeof schema === 'object' && (!schema.denormalize || typeof schema.denormalize !== 'function')) {
- 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 removeUserActions
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
removeUserActions(): IListAction<APIResource<CfUser>>[] {
const activeRouteCfOrgSpace = this.cfUserService.activeRouteCfOrgSpace;
const orgGuid = activeRouteCfOrgSpace.orgGuid;
const spaceGuid = activeRouteCfOrgSpace.spaceGuid;
const isCfContext = !orgGuid && !spaceGuid;
- 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 handleFileInputSelection
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
handleFileInputSelection(items): Observable<FileScannerInfo> {
const obs$ = new BehaviorSubject<DeployApplicationFSScanner>(undefined);
let scanner = new DeployApplicationFSScanner(CF_DEFAULT_IGNORES);
let cfIgnoreFile;
let manifestFile = false;
- 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"