bullhorn/career-portal

View on GitHub

Showing 83 of 83 total issues

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

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

      public shareTwitter(): void {
        this.shareService.twitter(this.job);
        this.analytics.trackEvent(`Shared Job: ${this.id} via Twitter`);
      }
    Severity: Major
    Found in src/app/job-details/job-details.component.ts and 2 other locations - About 1 hr to fix
    src/app/job-details/job-details.component.ts on lines 89..92
    src/app/job-details/job-details.component.ts on lines 99..102

    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 59.

    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

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

      public shareLinkedin(): void {
        this.shareService.linkedin(this.job);
        this.analytics.trackEvent(`Shared Job: ${this.id} via LinkedIn`);
      }
    Severity: Major
    Found in src/app/job-details/job-details.component.ts and 2 other locations - About 1 hr to fix
    src/app/job-details/job-details.component.ts on lines 89..92
    src/app/job-details/job-details.component.ts on lines 94..97

    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 59.

    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

    Further Reading

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

      public shareFacebook(): void {
        this.shareService.facebook(this.job);
        this.analytics.trackEvent(`Shared Job: ${this.id} via Facebook`);
      }
    Severity: Major
    Found in src/app/job-details/job-details.component.ts and 2 other locations - About 1 hr to fix
    src/app/job-details/job-details.component.ts on lines 94..97
    src/app/job-details/job-details.component.ts on lines 99..102

    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 59.

    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

    Further Reading

    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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      { name: 'loc', text: `${req.protocol}://${req.hostname}${req.originalUrl.replace('/sitemap', '/jobs')}/${job.id}` },
          Severity: Major
          Found in generateXml.ts and 1 other location - About 1 hr to fix
          generateXml.ts on lines 61..61

          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 58.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              this.phoneNumber = new TextBoxControl({
                key: 'phone',
                label: this.translate.instant('PHONE'),
                type: 'tel',
                required: false,
          Severity: Major
          Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 1 hr to fix
          src/app/apply-modal/apply-modal.component.ts on lines 80..87

          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 58.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      { name: 'link', text: `${req.protocol}://${req.hostname}${req.originalUrl.replace('/feed', '/jobs')}/${job.id}`},
          Severity: Major
          Found in generateXml.ts and 1 other location - About 1 hr to fix
          generateXml.ts on lines 24..24

          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 58.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              this.email = new TextBoxControl({
                key: 'email',
                label: this.translate.instant('EMAIL'),
                type: 'email',
                required: true,
          Severity: Major
          Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 1 hr to fix
          src/app/apply-modal/apply-modal.component.ts on lines 88..95

          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 58.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            server.get('/sitemap', (req: any, res: any) => {
              res.type('application/xml');
              res.contentType('application/xml');
              generateSitemap(appConfig, res, req);
            });
          Severity: Major
          Found in server.ts and 1 other location - About 1 hr to fix
          server.ts on lines 66..70

          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 57.

          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

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            server.get('/feed', (req: any, res: any) => {
              res.type('application/xml');
              res.contentType('application/xml');
              generateRss(appConfig, res, req);
            });
          Severity: Major
          Found in server.ts and 1 other location - About 1 hr to fix
          server.ts on lines 60..64

          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 57.

          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

          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 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 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

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              public facebook(job: any): any {
                window.open(this.config.url.facebook + this.requestParams.facebook(job));
              }
            Severity: Major
            Found in src/app/services/share/share.service.ts and 2 other locations - About 1 hr to fix
            src/app/services/share/share.service.ts on lines 39..41
            src/app/services/share/share.service.ts on lines 48..50

            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 56.

            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

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              public twitter(job: any): any {
                window.open(this.config.url.twitter + this.requestParams.twitter(job));
              }
            Severity: Major
            Found in src/app/services/share/share.service.ts and 2 other locations - About 1 hr to fix
            src/app/services/share/share.service.ts on lines 35..37
            src/app/services/share/share.service.ts on lines 39..41

            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 56.

            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

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

              public linkedin(job: any): any {
                window.open(this.config.url.linkedin + this.requestParams.linkedin(job));
              }
            Severity: Major
            Found in src/app/services/share/share.service.ts and 2 other locations - About 1 hr to fix
            src/app/services/share/share.service.ts on lines 35..37
            src/app/services/share/share.service.ts on lines 48..50

            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 56.

            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

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                  try {
                        fallbackTranslations = await this.translationFetcher(language);
                        this.transferState.set(fallbackKey, fallbackTranslations);
                    } catch (e) {
                        fallbackTranslations = {};
            Severity: Minor
            Found in src/app/services/localization/server-loader.ts and 1 other location - About 55 mins to fix
            src/app/services/localization/server-loader.ts on lines 46..51

            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 54.

            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

            Further Reading

            Severity
            Category
            Status
            Source
            Language