• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-grape / grape / 25610885355 / 37
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: refactor/de-morgan-conditions
DEFAULT BRANCH: master
Ran 09 May 2026 08:22PM UTC
Files 156
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 May 2026 08:20PM UTC coverage: 95.685% (+0.02%) from 95.662%
25610885355.37

Pull #2707

github

ericproulx
Tighten six guard conditions via De Morgan / blank? / present? / include?

Six spots where an `if`/`unless` clause used multiple negations
joined by `&&` or `||`, or `&.any?` on a Hash. Each rewrite expresses
the positive shape of the predicate and keeps `if` over `unless`
where natural. Same behaviour, same allocation profile (one form
even reuses a previously-recomputed `Hash#except` result).

* `Grape::API::Boolean.build` —
  `val != true && val != false` → frozen `VALUES` constant +
  `unless VALUES.include?(val)`.

* `Grape::Request#make_params` —
  `routing_args&.any? { |k, _| k != :version && k != :route_info }` +
  separate `routing_args.except(:version, :route_info)` two lines
  later → compute `except` once, gate on `filtered.blank?`.

* `Grape::Validations::ParamsScope#check_incompatible_option_values`
  (early guard) —
  `return unless default && !default.is_a?(Proc)` →
  `return if default.nil? || default.is_a?(Proc)`.

* `Grape::Validations::ParamsScope#check_incompatible_option_values`
  (raise condition) —
  `!Array(default).all? { |v| values.include?(v) }` →
  `Array(default).any? { |v| !values.include?(v) }`.

* `Grape::Validations::Validators::Base#scrub` —
  `unless value.respond_to?(:valid_encoding?) && !value.valid_encoding?`
  → `if !value.respond_to?(:valid_encoding?) || value.valid_encoding?`.

* `Grape::DSL::Routing#route` —
  `route_options&.any?` → `route_options.present?`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Pull Request #2707: Tighten five guard conditions via De Morgan / blank? / include?

1056 of 1165 branches covered (90.64%)

Branch coverage included in aggregate %.

3379 of 3470 relevant lines covered (97.38%)

1008.45 hits per line

Source Files on job run-3.2-gemfiles/rack_2_2.gemfile - 25610885355.37
  • Tree
  • List 156
  • Changed 5
  • Source Changed 5
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25610885355
  • abc0d711 on github
  • Prev Job for on refactor/de-morgan-conditions (#25608800647.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc