-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion rate rebased to v1.9.3 #2242
base: v1.9
Are you sure you want to change the base?
Conversation
@@ -614,6 +614,7 @@ def build_sql_reaction_sample(columns, c_id, ids, checkedAll = false) | |||
# reactions_sample: | |||
equivalent: ['r_s.equivalent', '"r eq"', 10], | |||
reference: ['r_s.reference', '"r ref"', 10], | |||
conversion_rate: ['r_s.conversion_rate', '"r conversion rate"', 10], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/ModuleLength: Module has too many lines. [611/100]
@@ -111,7 +111,7 @@ def create_new_sample(sample, fixed_label) | |||
:id, :is_new, :is_split, :reference, :equivalent, :position, | |||
:type, :molecule, :collection_id, :short_label, :waste, :show_label, :coefficient, :user_labels, | |||
:boiling_point_lowerbound, :boiling_point_upperbound, | |||
:melting_point_lowerbound, :melting_point_upperbound, :segments | |||
:melting_point_lowerbound, :melting_point_upperbound, :segments, :conversion_rate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for create_new_sample is too high. [<7, 30, 4> 31.06/25]
@@ -82,6 +82,7 @@ class Import::ImportJson | |||
# 'r_uuid' => nil, | |||
# 'r_reference' => nil, | |||
# 'r_equivalent' => nil, | |||
# 'r_conversion_rate' => nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/ClassLength: Class has too many lines. [284/200]
@@ -374,7 +375,8 @@ def add_to_reaction(klass, el, new_el) | |||
if new_data && new_data[r_uuid] && new_data[r_uuid]['id'] | |||
@log['samples'][el_uuid][klass.name] = klass.create( | |||
sample_id: new_el.id, reaction_id: new_data[r_uuid]['id'], | |||
reference: ref, equivalent: eq, position: el['r_position'] | |||
reference: ref, equivalent: eq, position: el['r_position'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for add_to_reaction is too high. [<6, 26, 9> 28.16/25]
@@ -374,7 +375,8 @@ def add_to_reaction(klass, el, new_el) | |||
if new_data && new_data[r_uuid] && new_data[r_uuid]['id'] | |||
@log['samples'][el_uuid][klass.name] = klass.create( | |||
sample_id: new_el.id, reaction_id: new_data[r_uuid]['id'], | |||
reference: ref, equivalent: eq, position: el['r_position'] | |||
reference: ref, equivalent: eq, position: el['r_position'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/ConditionalAssignment: Use the return of the conditional for variable assignment and comparison.
@@ -374,7 +375,8 @@ def add_to_reaction(klass, el, new_el) | |||
if new_data && new_data[r_uuid] && new_data[r_uuid]['id'] | |||
@log['samples'][el_uuid][klass.name] = klass.create( | |||
sample_id: new_el.id, reaction_id: new_data[r_uuid]['id'], | |||
reference: ref, equivalent: eq, position: el['r_position'] | |||
reference: ref, equivalent: eq, position: el['r_position'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.
@@ -333,7 +333,7 @@ def material_hash(material, is_product=false) | |||
mol: valid_digit(mmol, digit), | |||
mmol_unit: mmol_unit, | |||
equiv: valid_digit(s.equivalent, digit), | |||
molecule_name_hash: s[:molecule_name_hash] | |||
molecule_name_hash: s[:molecule_name_hash], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/ClassLength: Class has too many lines. [606/200]
@@ -333,7 +333,7 @@ def material_hash(material, is_product=false) | |||
mol: valid_digit(mmol, digit), | |||
mmol_unit: mmol_unit, | |||
equiv: valid_digit(s.equivalent, digit), | |||
molecule_name_hash: s[:molecule_name_hash] | |||
molecule_name_hash: s[:molecule_name_hash], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/AbcSize: Assignment Branch Condition size for material_hash is too high. [<10, 51, 7> 52.44/25]
@@ -333,7 +333,7 @@ def material_hash(material, is_product=false) | |||
mol: valid_digit(mmol, digit), | |||
mmol_unit: mmol_unit, | |||
equiv: valid_digit(s.equivalent, digit), | |||
molecule_name_hash: s[:molecule_name_hash] | |||
molecule_name_hash: s[:molecule_name_hash], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/CyclomaticComplexity: Cyclomatic complexity for material_hash is too high. [8/7]
@@ -333,7 +333,7 @@ def material_hash(material, is_product=false) | |||
mol: valid_digit(mmol, digit), | |||
mmol_unit: mmol_unit, | |||
equiv: valid_digit(s.equivalent, digit), | |||
molecule_name_hash: s[:molecule_name_hash] | |||
molecule_name_hash: s[:molecule_name_hash], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/MethodLength: Method has too many lines. [32/30]
2bd68f2
to
6adfa08
Compare
6adfa08
to
bd5f05f
Compare
app/api/chemotion/attachment_api.rb
Outdated
ElementPermissionProxy.new(current_user, element, user_ids).read_dataset?) | ||
|
||
if !can_dwnld && (element = @attachment.container&.root&.containable || @attachment.attachable) | ||
can_dwnld = if element.is_a?(Container) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/BlockNesting: Avoid more than 3 levels of block nesting.
app/mailers/welcome_mailer.rb
Outdated
@message = content_path.read | ||
@output = markdown(@message) | ||
|
||
mail(to: @user.email, subject: '[ELN] Welcome to Chemotion.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails/I18nLocaleTexts: Move locale texts to the locale files in the config/locales
directory.
app/models/report.rb
Outdated
@@ -20,8 +20,7 @@ | |||
# updated_at :datetime not null | |||
# template :string default("standard") | |||
# mol_serials :text default([]) | |||
# si_reaction_settings :text default({"Name"=>true, "CAS"=>true, "Formula"=>true, "Smiles"=>true, | |||
# "InCHI"=>true, "Molecular Mass"=>true, "Exact Mass"=>true, "EA"=>true}) | |||
# si_reaction_settings :text default({"Name"=>true, "CAS"=>true, "Formula"=>true, "Smiles"=>true, "InCHI"=>true, "Molecular Mass"=>true, "Exact Mass"=>true, "EA"=>true}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/LineLength: Line is too long. [182/120]
app/models/user.rb
Outdated
end | ||
self.profile.update_columns(data: data) | ||
def profile | ||
super || (new_record? && build_profile ) || create_profile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/SpaceInsideParens: Space inside parentheses detected.
@@ -333,7 +333,7 @@ def material_hash(material, is_product=false) | |||
mol: valid_digit(mmol, digit), | |||
mmol_unit: mmol_unit, | |||
equiv: valid_digit(s.equivalent, digit), | |||
molecule_name_hash: s[:molecule_name_hash] | |||
molecule_name_hash: s[:molecule_name_hash], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/ClassLength: Class has too many lines. [605/200]
@@ -423,7 +479,7 @@ | |||
end | |||
|
|||
describe 'POST /api/v1/attachments/thumbnails' do | |||
pending 'not yet implemented' | |||
pending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSpec/PendingWithoutReason: Give the reason for pending.
bd5f05f
to
e4330d7
Compare
e4330d7
to
c629eb6
Compare
rather 1-story 1-commit than sub-atomic commits
commit title is meaningful => git history search
commit description is helpful => helps the reviewer to understand the changes
code is up-to-date with the latest developments of the target branch (rebased to it or whatever) => ⏩-merge for linear history is favoured
added code is linted
tests are passing (at least locally): we still have some random test failure on CI. thinking of asking spec/examples.txt to be commited
in case the changes are visible to the end-user, video or screenshots should be added to the PR => helps with user testing
testing coverage improvement is improved.
CHANGELOG : add a bullet point on top (optional: reference to github issue/PR )
parallele PR for documentation on docusaurus if the feature/fix is tagged for a release