Showing 20 of 83 total issues
Function setupForm
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
public setupForm(): void {
this.firstName = new TextBoxControl({
key: 'firstName',
label: this.translate.instant('FIRST_NAME'),
required: true,
Function setFieldOptionsOnSuccess
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
private setFieldOptionsOnSuccess(res: any): void {
let interaction: Function;
switch (this.field) {
case 'address(city)':
this.options = res.data.map((result: IAddressListResponse) => {
Function setConfig
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async setConfig(data: ISettings): Promise<any> {
SettingsService.settings = data;
const objectConfigOptions: string[] = [
'service',
File apply-modal.component.ts
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { Component, OnInit } from '@angular/core';
import {
NovoFormGroup,
FormUtils,
NovoModalRef,
Function ngOnChanges
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public ngOnChanges(): void {
let jsonObject: object = {
'@context': 'https://schema.org/',
'@type': 'JobPosting',
'title': this.jobData.title,
Function setCache
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public setCache(directive: HttpCacheDirective, maxAge?: string, smaxAge?: string): this {
if (this.response) {
// tslint:disable-next-line:max-line-length
if (smaxAge) {
this.setHeader('Cache-Control', `${directive}, max-age=${maxAge ? ms(maxAge) / 1000 : 0}, s-maxage=${ms(smaxAge) / 1000}`);
- 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 save
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public save(): void {
if (this.form.valid) {
this.applying = true;
this.analytics.trackEvent(`Apply to Job: ${this.job.id}`);
let requestParams: any = {
- 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 generateRss
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function generateRss(appConfig: ISettings, res: any, req: any): any {
let jobListings: any = {
children: [], title: `${appConfig.companyName} Job Opportunities`, link: `${req.protocol}://${req.hostname}${req.originalUrl}`, pubDate: new Date().toUTCString(), ttl: 5};
let jobsUrl: string = `https://public-rest${appConfig.service.swimlane}.bullhornstaffing.com/rest-services/${appConfig.service.corpToken}/search/JobOrder?query=(isOpen:1%20AND%20isDeleted:0)${getQuery(appConfig)}&fields=id,title,address(city,state,zip),employmentType,dateLastPublished,publicDescription&count=500&sort=-dateLastPublished&start=0`;
let body: string = '';
Function app
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function app(): express.Express {
const server: any = express();
const distFolder: any = join(process.cwd(), 'dist/career-portal/browser');
const indexHtml: any = existsSync(join(distFolder, 'index.original.html')) ? 'index.original.html' : 'index';
const template: any = readFileSync(join(distFolder, 'index.html')).toString();
Function save
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public save(): void {
if (this.form.valid) {
this.applying = true;
this.analytics.trackEvent(`Apply to Job: ${this.job.id}`);
let requestParams: any = {
Function getAvailableFilterOptions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public getAvailableFilterOptions(ids: number[], field: string): Observable<any> {
let params: any = {};
let queryArray: string[] = [];
if (ids.length > 0) {
params.where = `id IN (${ids.toString()})`;
Function getQuery
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function getQuery(appConfig: ISettings): string {
const isSearch: boolean = true;
let field: string = appConfig.additionalJobCriteria.field;
let values: string[] = appConfig.additionalJobCriteria.values;
let query: string = '';
- 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 formatAdditionalCriteria
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private formatAdditionalCriteria(isSearch: boolean): string {
let field: string = SettingsService.settings.additionalJobCriteria.field;
let values: string[] = SettingsService.settings.additionalJobCriteria.values;
let query: string = '';
let delimiter: '"' | '\'' = isSearch ? '"' : '\'';
- 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 searchOnDelay
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public searchOnDelay(): void {
const keywordSearchFields: string[] =
SettingsService.settings.service.keywordSearchFields;
if (this.timeout) {
clearTimeout(this.timeout);
Function formatFilter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private formatFilter(filter: object, isSearch: boolean, ignoreFields: string[] = []): string {
let additionalFilter: string = '';
for (let key in filter) {
if (!ignoreFields.includes(key)) {
let filterValue: string | string[] = filter[key];
- 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 getPreferredLanguage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private getPreferredLanguage(): string {
let supportedLanguages: string[] = SettingsService.settings.supportedLocales || [];
let language: string = SettingsService.settings.defaultLocale;
if (SettingsService.isServer) {
language = <string>this.request['acceptsLanguages'](supportedLanguages);
- 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 setConfig
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public async setConfig(data: ISettings): Promise<any> {
SettingsService.settings = data;
const objectConfigOptions: string[] = [
'service',
- 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 additionalEmailInfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private additionalEmailInfo(job: any): any {
let body: any = '\n';
if (job.title) {
body += '\nTitle: Jobs';
}
- 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 getAvailableFilterOptions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public getAvailableFilterOptions(ids: number[], field: string): Observable<any> {
let params: any = {};
let queryArray: string[] = [];
if (ids.length > 0) {
params.where = `id IN (${ids.toString()})`;
- 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 searchOnDelay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public searchOnDelay(): void {
const keywordSearchFields: string[] =
SettingsService.settings.service.keywordSearchFields;
if (this.timeout) {
clearTimeout(this.timeout);
- 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"