Showing 50 of 78 total issues
Method jasms_2002_3_b2_formaldehyde_loss
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
::Rule_names << def jasms_2002_3_b2_formaldehyde_loss(only_uniqs: true, fragment_adduct_state: :as_published)
fragment_sets = []
fragment = lambda do |*arr|
# duplicate
(nmol, (alcohol_oxygen, alcohol_carbon, link_carbon)) = self.dup_molecule(arr)
Method jasms_2002_2_f2_bprime_water_loss
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
::Rearrangements << def jasms_2002_2_f2_bprime_water_loss(only_uniqs: true, fragment_adduct_state: :as_published)
fragment_sets = []
fragment = lambda do |*arr|
# duplicate
(nmol, (linked_carbon, alcohol_carbon, oxygen)) = self.dup_molecule(arr)
Method jasms_2002_5_e2
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
::Rule_names << def jasms_2002_5_e2(only_uniqs: true, fragment_adduct_state: :as_published)
fragment_sets = []
fragment = lambda do |*arr|
# duplicate
(nmol, (nitrogen, carbonyl, carbonyl_oxygen, c2)) = self.dup_molecule(arr)
Method jasms_2002_4_g2a
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
::Rule_names << def jasms_2002_4_g2a(only_uniqs: true, fragment_adduct_state: :as_published)
fragment_sets = []
fragment = lambda do |*arr|
# duplicate
(nmol, (alcohol_oxygen, alcohol_carbon, acc1, aco1)) = self.dup_molecule(arr)
Method jasms_2002_2_f1_bprime
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
::Rule_names << def jasms_2002_2_f1_bprime(only_uniqs: true, fragment_adduct_state: :as_published)
fragment_sets = []
fragment = lambda do |*arr|
# duplicate
(nmol, (lost_oxygen, attacked_carbon, nitrogen)) = self.dup_molecule(arr)
Method jasms_2002_5_e1_water_loss
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
::Rule_names << def jasms_2002_5_e1_water_loss(only_uniqs: true, fragment_adduct_state: :as_published)
fragment_sets = []
fragment = lambda do |*arr|
# duplicate
(nmol, (alcohol_carbon, alcohol_oxygen, attacked_carbon, lost_oxygen)) = self.dup_molecule(arr)
Method nitrogen_cyclization
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
::Rule_names << def nitrogen_cyclization
#TODO remove this next line
only_uniqs = true
fragment_sets = []
# Create a fragmentation block method
Method carbonyl_oxygen_dump
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
::Rule_names << def carbonyl_oxygen_dump(only_uniqs: true, fragment_adduct_state: :as_published)
fragment_sets = []
only_uniqs = true
fragment = lambda do |carbon, oxygen, carbon_nbr|
appendage = oxygen.atoms.find {|a| a.el != :C }
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method create_bins
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def create_bins(true_values, comparison_values, bin_width: PPM_BIN_DEFAULT)
min, max = [true_values.minmax, comparison_values.minmax].flatten.minmax
divisions = []
puts "using bin width: #{bin_width}" if $VERBOSE
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method jasms_2002_scheme1_c_e2aprime_formaldehyde_loss
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
::Rule_names << def jasms_2002_scheme1_c_e2aprime_formaldehyde_loss(only_uniqs: true, fragment_adduct_state: :as_published)
fragment_sets = []
fragment = lambda do |*arr|
#duplications and mapping
(nmol,(carbon1, carbon2, oxygen, carbon3)) = self.dup_molecule(arr)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"