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

ruby-grape / grape / 25610832363 / 12
97%
master: 97%

Build:
Build:
LAST BUILD BRANCH: refactor/de-morgan-conditions
DEFAULT BRANCH: master
Ran 09 May 2026 08:19PM UTC
Files 157
Run time 5s
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:17PM UTC coverage: 95.667% (+0.003%) from 95.664%
25610832363.12

Pull #2707

github

ericproulx
Tighten five guard conditions via De Morgan / blank? / include?

Five spots where an `if`/`unless` clause used multiple negations
joined by `&&` or `||`. 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?`.

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

1058 of 1167 branches covered (90.66%)

Branch coverage included in aggregate %.

3380 of 3472 relevant lines covered (97.35%)

1006.07 hits per line

Source Files on job run-3.3-gemfiles/rails_8_1.gemfile - 25610832363.12
  • Tree
  • List 157
  • Changed 4
  • Source Changed 4
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 25610832363
  • 464ccd6f on github
  • Prev Job for on refactor/de-morgan-conditions (#25608800647.8)
  • Next Job for on refactor/de-morgan-conditions (#25610885355.4)
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