Closed newbthenewbd closed 8 months ago
As I mentioned in #14, all the snake_case names that Rubocop thinks badly formatted could have the offending from_H
changed to e.g. at_geopotential
...
With the then-remaining issues, however, I feel that fixing some of them may actually go contrary to readability?
Take for example this complaint:
lib/atmospheric/isa.rb:211:7: C: Method has too many lines. [23/10]
def pressure_from_H(geopotential_alt) ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Referring to this method:
# Pressure for a given geopotential altitude `H` (m) above mean sea level
def pressure_from_H(geopotential_alt)
i = locate_lower_layer(geopotential_alt)
lower_temperature_layer = TEMPERATURE_LAYERS[i]
beta = lower_temperature_layer[:B]
capital_h_b = lower_temperature_layer[:H]
capital_t_b = lower_temperature_layer[:T]
temp = temperature_at_layer_from_H(geopotential_alt)
p_b = pressure_layers[i]
if beta != 0
# Formula (12)
pressure_formula_beta_nonzero(
p_b,
beta,
capital_t_b,
geopotential_alt - capital_h_b,
)
else
# Formula (13)
pressure_formula_beta_zero(
p_b,
temp,
geopotential_alt - capital_h_b,
)
end
end
Can easily be compressed, but is it truly what we want?
Can easily be compressed, but is it truly what we want?
We can add a line to ask Rubocop to ignore that method and get it done with.
Merging first.
This reduces the complaint count to a total to 23, which may actually be slightly more problematic to correct:
Metanorma PR checklist