princelab/msplinter

View on GitHub

Showing 50 of 78 total issues

Method jasms_2002_2_f1_aprime has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      ::Rule_names << def jasms_2002_2_f1_aprime(only_uniqs: true, fragment_adduct_state: :as_published)
        fragment_sets = []
        fragment = lambda do |*arr|
          # duplicate
          (nmol, (cyclized_oxygen, linked_to_nitrogen_carbon, attacked_carbon, lost_oxygen)) = self.dup_molecule(arr)
Severity: Minor
Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb - About 1 hr to fix

    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)
    Severity: Minor
    Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb - About 1 hr to fix

      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)
      Severity: Minor
      Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb - About 1 hr to fix

        Method jasms_2002_3_b1 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              ::Rule_names << def jasms_2002_3_b1(only_uniqs: true, fragment_adduct_state: :as_published)
                fragment_sets = []
                fragment = lambda do |*arr|
                  # duplicate
                  (nmol, (alcohol_oxygen, alcohol_carbon, link_carbon, nitrogen, carbonyl, carbonyl_oxygen)) = self.dup_molecule(arr)
        Severity: Minor
        Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb - About 1 hr to fix

          Method jasms_2002_4_g2a_prime has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                ::Rule_names << def jasms_2002_4_g2a_prime(only_uniqs: true, fragment_adduct_state: :as_published)
                  fragment_sets = []
                  fragment = lambda do |*arr|
                    # duplicate
                    (nmol, (alcohol_oxygen, alcohol_carbon, nitrogen)) = self.dup_molecule(arr)
          Severity: Minor
          Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb - About 1 hr to fix

            Method jasms_2002_4_g2a_prime_water_loss has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  ::Rule_names << def jasms_2002_4_g2a_prime_water_loss(only_uniqs: true, fragment_adduct_state: :as_published)
                    fragment_sets = []
                    fragment = lambda do |*arr|
                      # duplicate
                      (nmol, (alcohol_oxygen, alcohol_carbon, ring_carbon)) = self.dup_molecule(arr)
            Severity: Minor
            Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb - About 1 hr to fix

              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
              Severity: Minor
              Found in lib/rubabel/molecule/fragmentable/nitrogen_cyclization_rule.rb - About 1 hr to fix

                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 }
                Severity: Minor
                Found in lib/rubabel/molecule/fragmentable/tamil_rules.rb - About 45 mins to fix

                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)
                Severity: Minor
                Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme1.rb - About 25 mins to fix

                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
                Severity: Minor
                Found in generate_comparison_scores.rb - About 25 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language