bullhorn/career-portal

View on GitHub

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,
Severity: Major
Found in src/app/apply-modal/apply-modal.component.ts - About 4 hrs to fix

    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) => {
    Severity: Major
    Found in src/app/sidebar/sidebar-filter/sidebar-filter.component.ts - About 3 hrs to fix

      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',
      Severity: Major
      Found in src/app/services/settings/settings.service.ts - About 2 hrs to fix

        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,
        Severity: Minor
        Found in src/app/apply-modal/apply-modal.component.ts - About 2 hrs to fix

          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,
          Severity: Minor
          Found in src/app/structured-seo/structured-seo.component.ts - About 1 hr to fix

            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}`);
            Severity: Minor
            Found in src/app/services/server-response/server-response.service.ts - About 1 hr to fix

            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 = {
            Severity: Minor
            Found in src/app/apply-modal/apply-modal.component.ts - About 1 hr to fix

            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 = '';
            Severity: Minor
            Found in generateXml.ts - About 1 hr to fix

              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();
              Severity: Minor
              Found in server.ts - About 1 hr to fix

                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 = {
                Severity: Minor
                Found in src/app/apply-modal/apply-modal.component.ts - About 1 hr to fix

                  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()})`;
                  Severity: Minor
                  Found in src/app/services/search/search.service.ts - About 1 hr to fix

                    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 = '';
                    Severity: Minor
                    Found in generateXml.ts - About 1 hr to fix

                    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 ? '"' : '\'';
                    Severity: Minor
                    Found in src/app/services/search/search.service.ts - About 1 hr to fix

                    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);
                    Severity: Minor
                    Found in src/app/sidebar/sidebar.component.ts - About 1 hr to fix

                      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];
                      Severity: Minor
                      Found in src/app/services/search/search.service.ts - About 55 mins to fix

                      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);
                      Severity: Minor
                      Found in src/app/services/settings/settings.service.ts - About 55 mins to fix

                      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',
                      Severity: Minor
                      Found in src/app/services/settings/settings.service.ts - About 55 mins to fix

                      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';
                          }
                      Severity: Minor
                      Found in src/app/services/share/share.service.ts - About 45 mins to fix

                      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()})`;
                      Severity: Minor
                      Found in src/app/services/search/search.service.ts - About 25 mins to fix

                      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);
                      Severity: Minor
                      Found in src/app/sidebar/sidebar.component.ts - About 25 mins to fix

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language