Skip to content

build: stage 3.1.0#2982

Draft
PiTrem wants to merge 7 commits intov3.xfrom
next-release
Draft

build: stage 3.1.0#2982
PiTrem wants to merge 7 commits intov3.xfrom
next-release

Conversation

@PiTrem
Copy link
Member

@PiTrem PiTrem commented Feb 28, 2026

No description provided.

@PiTrem PiTrem marked this pull request as draft February 28, 2026 11:09
params do
requires :chemical_data, type: Array[Hash], desc: 'chemical data'
optional :cas, type: String, desc: 'cas number'
optional :sample_id, type: Integer

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. [205/200]

-- molecules
inner join molecules m on s.molecule_id = m.id
where rsm.reaction_id in (#{selection})

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. [913/100]

-- molecules
inner join molecules m on s.molecule_id = m.id
where rsm.reaction_id in (#{selection})

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. [104/30]

# desc: SM.R>>P
def r_smiles_1(v)
((v['0'] || []) + (v['1'] || [])).join('.') \
((v['0'] || []) + formatted_reactants(v['1'])).join('.') \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringConcatenation: Prefer string interpolation to string concatenation.

# desc: SM.R.S>>P
def r_smiles_2(v)
((v['0'] || []) + (v['1'] || []) + (v['2'] || [])).join('.') \
((v['0'] || []) + formatted_reactants(v['1']) + (v['2'] || [])).join('.') \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringConcatenation: Prefer string interpolation to string concatenation.

super
end

def is_new

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming/PredicatePrefix: Rename is_new to new?.

to_boolean super
end

def to_boolean(string)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming/PredicateMethod: Predicate method names should end with ?.

solvent: Array(materials['solvents']).map { |m| OSample.new(m) },
purification_solvent: Array(materials['purification_solvents']).map { |m| OSample.new(m) },
product: Array(materials['products']).map { |m| OSample.new(m) },
reactant_sbmm: Array(materials['reactant_sbmm_samples'] || []).map { |m| OSbmmSample.new(m) },

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. [357/200]

solvent: Array(materials['solvents']).map { |m| OSample.new(m) },
purification_solvent: Array(materials['purification_solvents']).map { |m| OSample.new(m) },
product: Array(materials['products']).map { |m| OSample.new(m) },
reactant_sbmm: Array(materials['reactant_sbmm_samples'] || []).map { |m| OSbmmSample.new(m) },

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 initialize is too high. [<10, 24, 7> 26.93/25]

solvent: Array(materials['solvents']).map { |m| OSample.new(m) },
purification_solvent: Array(materials['purification_solvents']).map { |m| OSample.new(m) },
product: Array(materials['products']).map { |m| OSample.new(m) },
reactant_sbmm: Array(materials['reactant_sbmm_samples'] || []).map { |m| OSbmmSample.new(m) },

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 initialize is too high. [8/7]

end
ActiveRecord::Base.transaction do
modified_sample_ids = []
modified_sbmm_ids = []

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 execute! is too high. [<17, 39, 26> 49.86/25]

end
ActiveRecord::Base.transaction do
modified_sample_ids = []
modified_sbmm_ids = []

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 execute! is too high. [19/7]

end
ActiveRecord::Base.transaction do
modified_sample_ids = []
modified_sbmm_ids = []

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. [61/30]

end
ActiveRecord::Base.transaction do
modified_sample_ids = []
modified_sbmm_ids = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/PerceivedComplexity: Perceived complexity for execute! is too high. [22/8]

end
ActiveRecord::Base.transaction do
modified_sample_ids = []
modified_sbmm_ids = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/BlockLength: Block has too many lines. [42/25]

Array(obj.reactant_sbmm_samples)
end

def sbmm_material_hash(material)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/PerceivedComplexity: Perceived complexity for sbmm_material_hash is too high. [12/8]

end

def sbmm_material_hash(material)
s = OpenStruct.new(material)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/OpenStructUse: Avoid using OpenStruct; use Struct, Hash, a class or test doubles instead.

molecule_name_hash: { label: sbmm_name },
components: [],
is_mixture: false,
weight_percentage: (@obj.weight_percentage && s.weight_percentage.present?) ? valid_digit(s.weight_percentage, digit) : '',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/TernaryParentheses: Omit parentheses for ternary conditions.

molecule_name_hash: { label: sbmm_name },
components: [],
is_mixture: false,
weight_percentage: (@obj.weight_percentage && s.weight_percentage.present?) ? valid_digit(s.weight_percentage, digit) : '',

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. [133/120]

{ 'insert' => '} ' },
*sample_molecule_name_delta(m),
{ 'insert' => " (#{valid_digit(m[:vol], 2)} mL); " }]
{"insert"=>" (#{valid_digit(m[:vol], 2)} #{normalize_liter_unit(m[:vol_unit])}); "}]

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 materials_table_delta is too high. [<18, 40, 3> 43.97/25]

{ 'insert' => '} ' },
*sample_molecule_name_delta(m),
{ 'insert' => " (#{valid_digit(m[:vol], 2)} mL); " }]
{"insert"=>" (#{valid_digit(m[:vol], 2)} #{normalize_liter_unit(m[:vol_unit])}); "}]

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. [35/30]

{ 'insert' => '} ' },
*sample_molecule_name_delta(m),
{ 'insert' => " (#{valid_digit(m[:vol], 2)} mL); " }]
{"insert"=>" (#{valid_digit(m[:vol], 2)} #{normalize_liter_unit(m[:vol_unit])}); "}]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideHashLiteralBraces: Space inside { missing.

{ 'insert' => '} ' },
*sample_molecule_name_delta(m),
{ 'insert' => " (#{valid_digit(m[:vol], 2)} mL); " }]
{"insert"=>" (#{valid_digit(m[:vol], 2)} #{normalize_liter_unit(m[:vol_unit])}); "}]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.

{ 'insert' => '} ' },
*sample_molecule_name_delta(m),
{ 'insert' => " (#{valid_digit(m[:vol], 2)} mL); " }]
{"insert"=>" (#{valid_digit(m[:vol], 2)} #{normalize_liter_unit(m[:vol_unit])}); "}]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceAroundOperators: Surrounding space missing for operator =>.

{ 'insert' => '} ' },
*sample_molecule_name_delta(m),
{ 'insert' => " (#{valid_digit(m[:vol], 2)} mL); " }]
{"insert"=>" (#{valid_digit(m[:vol], 2)} #{normalize_liter_unit(m[:vol_unit])}); "}]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/SpaceInsideHashLiteralBraces: Space inside } missing.

let!(:s2) { create(:sample, name: 'Sample 2') }
let!(:s3) { create(:sample, name: 'Sample 3') }
let!(:s4) { create(:sample, name: 'Solvent') }
let!(:sbmm) { create(:uniprot_sbmm) }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/MultipleMemoizedHelpers: Example group has too many memoized helpers [35/10]

end

it 'has correct content' do
sbmm_reactant = content[:reactants].find { |r| r[:short_label] == sbmm_sample.short_label }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/MultipleMemoizedHelpers: Example group has too many memoized helpers [36/10]

{ 'insert' => '} ' },
{ 'attributes' => { 'bold' => false, 'font-size' => 12 }, 'insert' => s4.preferred_label },
{ 'insert' => ' (56 mL); ' },
{ 'insert' => ' (56 ml); ' },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/MultipleMemoizedHelpers: Example group has too many memoized helpers [35/10]

expect(formula['O']).to be_within(1e-10).of(1.5)
end

it 'accepts hash fragments with symbol keys' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/MultipleExpectations: Example has too many expectations [4/3].

expect(formula['O']).to be_within(1e-10).of(0.5)
end

it 'accepts hash fragments with symbol keys' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RSpec/MultipleExpectations: Example has too many expectations [4/3].

@PiTrem PiTrem changed the title build: stage 3.0.1 build: stage 3.1.0 Mar 2, 2026
@PiTrem PiTrem changed the base branch from main to v3.x March 3, 2026 11:19
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

LCOV of commit 2131492 during CI - Ruby Lint, RSpec, and code coverage #992

Summary coverage rate:
  lines......: 67.1% (18487 of 27550 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

LCOV of commit b2cf0fc during CI - Ruby Lint, RSpec, and code coverage #997

Summary coverage rate:
  lines......: 67.1% (18487 of 27550 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

LCOV of commit d09015d during CI - Ruby Lint, RSpec, and code coverage #1003

Summary coverage rate:
  lines......: 67.1% (18498 of 27550 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@PiTrem PiTrem force-pushed the next-release branch 2 times, most recently from b53e939 to 6e6f504 Compare March 4, 2026 12:22
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

LCOV of commit 6e6f504 during CI - Ruby Lint, RSpec, and code coverage #1017

Summary coverage rate:
  lines......: 67.1% (18496 of 27559 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

scope = @shared_methods.order_by_molecule(scope) if @conditions[:model_name] == Sample
scope = scope.group("#{@conditions[:model_name].table_name}.id") if group_by_model_name
scope = scope.group('samples.id, molecules.sum_formular') if @conditions[:model_name] == Sample
scope = @shared_methods.order_by_created_at_desc(scope) if @conditions[:model_name] == Reaction
Copy link

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 basic_scope is too high. [<8, 24, 11> 27.59/25]

end

def order_by_created_at_desc(scope)
scope.order('created_at DESC')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rails/OrderArguments: Prefer created_at: :desc instead.

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

LCOV of commit 6a3c12f during CI - Ruby Lint, RSpec, and code coverage #1018

Summary coverage rate:
  lines......: 67.1% (18496 of 27559 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant