GSA/jobs_api

View on GitHub

Showing 81 of 83 total issues

Method import has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def import(position_openings)
      position_openings.each do |opening|
        data = opening.each_with_object(timestamp: DateTime.current) do |(key, value), d|
          d[key] =
            case key
Severity: Minor
Found in app/models/position_opening.rb - About 1 hr to fix

    Nokogiri gem, via libxml2, is affected by multiple vulnerabilities
    Open

        nokogiri (1.8.3)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-14404

    Criticality: High

    URL: https://github.com/sparklemotion/nokogiri/issues/1785

    Solution: upgrade to >= 1.8.5

    File Content Disclosure in Action View
    Open

        actionview (5.1.4)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2019-5418

    Criticality: High

    URL: https://groups.google.com/forum/#!topic/rubyonrails-security/pFRKI96Sm8Q

    Solution: upgrade to >= 4.2.11.1, ~> 4.2.11, >= 5.0.7.2, ~> 5.0.7, >= 5.1.6.2, ~> 5.1.6, >= 5.2.2.1, ~> 5.2.2, >= 6.0.0.beta3

    TZInfo relative path traversal vulnerability allows loading of arbitrary files
    Open

        tzinfo (1.2.4)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-31163

    Criticality: High

    URL: https://github.com/tzinfo/tzinfo/security/advisories/GHSA-5cm2-9h8c-rvfx

    Solution: upgrade to ~> 0.3.61, >= 1.2.10

    Regular Expression Denial of Service in websocket-extensions (RubyGem)
    Open

        websocket-extensions (0.1.3)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2020-7663

    Criticality: High

    URL: https://github.com/faye/websocket-extensions-ruby/security/advisories/GHSA-g6wq-qcwm-j5g2

    Solution: upgrade to >= 0.1.5

    rack-cors directory traversal via path
    Open

        rack-cors (1.0.2)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2019-18978

    Criticality: Medium

    URL: https://github.com/cyu/rack-cors/commit/e4d4fc362a4315808927011cbe5afcfe5486f17d

    Solution: upgrade to >= 1.0.4

    Denial of Service Vulnerability in Action View
    Open

        actionview (5.1.4)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2019-5419

    Criticality: High

    URL: https://groups.google.com/forum/#!topic/rubyonrails-security/GN7w9fFAQeI

    Solution: upgrade to >= 6.0.0.beta3, >= 5.2.2.1, ~> 5.2.2, >= 5.1.6.2, ~> 5.1.6, >= 5.0.7.2, ~> 5.0.7, >= 4.2.11.1, ~> 4.2.11

    Loofah XSS Vulnerability
    Open

        loofah (2.2.2)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-16468

    Criticality: Medium

    URL: https://github.com/flavorjones/loofah/issues/154

    Solution: upgrade to >= 2.2.3

    Denial of Service Vulnerability in Rack Content-Disposition parsing
    Open

        rack (2.0.5)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-44571

    URL: https://github.com/rack/rack/releases/tag/v3.0.4.1

    Solution: upgrade to >= 2.0.9.2, ~> 2.0.9, >= 2.1.4.2, ~> 2.1.4, >= 2.2.6.1, ~> 2.2.6, >= 3.0.4.1

    Denial of Service Vulnerability in Rack Multipart Parsing
    Open

        rack (2.0.5)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-30122

    Criticality: High

    URL: https://groups.google.com/g/ruby-security-ann/c/L2Axto442qk

    Solution: upgrade to >= 2.0.9.1, ~> 2.0.9, >= 2.1.4.1, ~> 2.1.4, >= 2.2.3.1

    Denial of service via multipart parsing in Rack
    Open

        rack (2.0.5)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-44572

    URL: https://github.com/rack/rack/releases/tag/v3.0.4.1

    Solution: upgrade to >= 2.0.9.2, ~> 2.0.9, >= 2.1.4.2, ~> 2.1.4, >= 2.2.6.1, ~> 2.2.6, >= 3.0.4.1

    Denial of service via header parsing in Rack
    Open

        rack (2.0.5)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-44570

    URL: https://github.com/rack/rack/releases/tag/v3.0.4.1

    Solution: upgrade to >= 2.0.9.2, ~> 2.0.9, >= 2.1.4.2, ~> 2.1.4, >= 2.2.6.2, ~> 2.2.6, >= 3.0.4.1

    Broken Access Control vulnerability in Active Job
    Open

        activejob (5.1.4)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-16476

    Criticality: High

    URL: https://groups.google.com/forum/#!topic/rubyonrails-security/FL4dSdzr2zw

    Solution: upgrade to ~> 4.2.11, ~> 5.0.7.1, ~> 5.1.6.1, ~> 5.1.7, >= 5.2.1.1

    Possible DoS vulnerability in Rack
    Open

        rack (2.0.5)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-16470

    URL: https://groups.google.com/forum/#!topic/ruby-security-ann/Dz4sRl-ktKk

    Solution: upgrade to >= 2.0.6

    Possible shell escape sequence injection vulnerability in Rack
    Open

        rack (2.0.5)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2022-30123

    Criticality: Critical

    URL: https://groups.google.com/g/ruby-security-ann/c/LWB10kWzag8

    Solution: upgrade to >= 2.0.9.1, ~> 2.0.9, >= 2.1.4.1, ~> 2.1.4, >= 2.2.3.1

    Possible information leak / session hijack vulnerability
    Open

        rack (2.0.5)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2019-16782

    Criticality: Medium

    URL: https://github.com/rack/rack/security/advisories/GHSA-hrqr-hxpp-chr3

    Solution: upgrade to ~> 1.6.12, >= 2.0.8

    Possible XSS vulnerability in Rack
    Open

        rack (2.0.5)
    Severity: Minor
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2018-16471

    URL: https://groups.google.com/forum/#!topic/ruby-security-ann/NAalCee8n6o

    Solution: upgrade to ~> 1.6.11, >= 2.0.6

    Method process_location_and_state has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

      def process_location_and_state(city_str, state_str)
        city = city_str =~ INVALID_LOCATION_REGEX ? nil : remove_trailing_state_zip(strip_prefix(city_str.squish)).rpartition(',')[2].to_s.squish
        state_name = state_str.squish
        state = State.member?(state_name) ? State.normalize(state_name) : nil
    
    
    Severity: Minor
    Found in lib/importers/neogov_data.rb - About 35 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

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

      XPATHS = {
        opening: '//xmlns:PositionOpening',
        start_date: 'xmlns:PositionProfile/xmlns:PositionPeriod/xmlns:StartDate/xmlns:FormattedDateTime',
        end_date: 'xmlns:PositionProfile/xmlns:PositionPeriod/xmlns:EndDate/xmlns:FormattedDateTime',
        position_title: 'xmlns:PositionProfile/xmlns:PositionTitle',
    Severity: Minor
    Found in lib/importers/usajobs_data.rb and 1 other location - About 25 mins to fix
    lib/importers/neogov_data.rb on lines 4..19

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

    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

      XPATHS = {
        organization_name: '/rss/channel/title',
        item: '//item',
        pubdate: './pubDate',
        start_date: './joblisting:advertiseFromDate',
    Severity: Minor
    Found in lib/importers/neogov_data.rb and 1 other location - About 25 mins to fix
    lib/importers/usajobs_data.rb on lines 6..21

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

    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