princelab/msplinter

View on GitHub
lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb

Summary

Maintainability
F
6 days
Test Coverage

File asms_2002_scheme2.rb has 421 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require_relative "../fragmentable"

#        self.write( 'root.svg', :add_atom_index => true)
module Rubabel
  class Molecule
Severity: Minor
Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb - About 6 hrs to fix

    Method jasms_2002_2_e1 has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          ::Rule_names << def jasms_2002_2_e1(only_uniqs: true, fragment_adduct_state: :as_published)
            fragment_sets = []
            fragment = lambda do |*arr|
              # duplicate
              (nmol, (nitrogen, carbonyl_carbon, carbonyl_oxygen, alcohol_carbon, alcohol_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_f2_b_methoxy_loss has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            ::Rearrangements << def jasms_2002_2_f2_b_methoxy_loss(only_uniqs: true, fragment_adduct_state: :as_published)
              fragment_sets = []
              fragment = lambda do |*arr|
                # duplicate
                (nmol, (c1, lost_carbon, oxygen, c2)) = 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_e2_b_formaldehyde_loss has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              ::Rule_names << def jasms_2002_2_e2_b_formaldehyde_loss(only_uniqs: true, fragment_adduct_state: :as_published)
                fragment_sets = []
                fragment = lambda do |*arr|
                  # duplicate
                  (nmol, (nitrogen, c1, c2, ester_oxygen, c3)) = 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_a1 has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                ::Rule_names << def jasms_2002_2_a1(only_uniqs: true, fragment_adduct_state: :as_published)
                  fragment_sets = []
                  fragment = lambda do |*arr|
                    # duplicate
                    (nmol, (base_c, alcohol_carbon, alcohol_oxygen, carbonyl_carbon, carbonyl_oxygen, nitrogen, ring_carbon)) = 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_e2_bprime_water_loss has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  ::Rule_names << def jasms_2002_2_e2_bprime_water_loss(only_uniqs: true, fragment_adduct_state: :as_published)
                    fragment_sets = []
                    fragment = lambda do |*arr|
                      # duplicate
                      (nmol, (alcohol_oxygen, c1, c2, 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_2_c2a has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    ::Rule_names << def jasms_2002_2_c2a(only_uniqs: true, fragment_adduct_state: :as_published)
                      fragment_sets = []
                      fragment = lambda do |*arr|
                        # duplicate
                        (nmol, (nitrogen, carbonyl_carbon, carbonyl_oxygen, alcohol_carbon, alcohol_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_e1_b has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      ::Rule_names << def jasms_2002_2_e1_b(only_uniqs: true, fragment_adduct_state: :as_published)
                        fragment_sets = []
                        fragment = lambda do |*arr|
                          # duplicate
                          (nmol, (alcohol_oxygen, nitrogen, attacked_carbon, leaving_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_e1_bprime has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        ::Rule_names << def jasms_2002_2_e1_bprime(only_uniqs: true, fragment_adduct_state: :as_published)
                          fragment_sets = []
                          fragment = lambda do |*arr|
                            # duplicate
                            (nmol, (alcohol_oxygen, attacked_carbon, carbon_linker, 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_2_e2_bprime_heterocyclic_loss has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          ::Rule_names << def jasms_2002_2_e2_bprime_heterocyclic_loss(only_uniqs: true, fragment_adduct_state: :as_published)
                            fragment_sets = []
                            fragment = lambda do |*arr|
                              # duplicate
                              (nmol, (nitrogen, ring_carbon, alcohol_carbon, alcohol_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 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            ::Rule_names << def jasms_2002_2_f1(only_uniqs: true, fragment_adduct_state: :as_published)
                              fragment_sets = []
                              fragment = lambda do |*arr|
                                # duplicate
                                (nmol, (nitrogen, carbonyl, alpha_carbon, alcohol_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_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)
                        Severity: Minor
                        Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb - About 1 hr to fix

                          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

                              Similar blocks of code found in 3 locations. Consider refactoring.
                              Open

                                    ::Rule_names << def jasms_2002_2_e1(only_uniqs: true, fragment_adduct_state: :as_published)
                                      fragment_sets = []
                                      fragment = lambda do |*arr|
                                        # duplicate
                                        (nmol, (nitrogen, carbonyl_carbon, carbonyl_oxygen, alcohol_carbon, alcohol_oxygen)) = self.dup_molecule(arr)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb and 2 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme1.rb on lines 346..381
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 435..469

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 136.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. Consider refactoring.
                              Open

                                    ::Rule_names << def jasms_2002_2_e2_bprime_water_loss(only_uniqs: true, fragment_adduct_state: :as_published)
                                      fragment_sets = []
                                      fragment = lambda do |*arr|
                                        # duplicate
                                        (nmol, (alcohol_oxygen, c1, c2, nitrogen)) = self.dup_molecule(arr)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb and 2 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme1.rb on lines 543..576
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb on lines 374..406

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 125.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. Consider refactoring.
                              Open

                                    ::Rule_names << def jasms_2002_2_e2_bprime_heterocyclic_loss(only_uniqs: true, fragment_adduct_state: :as_published)
                                      fragment_sets = []
                                      fragment = lambda do |*arr|
                                        # duplicate
                                        (nmol, (nitrogen, ring_carbon, alcohol_carbon, alcohol_oxygen)) = self.dup_molecule(arr)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb and 2 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme1.rb on lines 543..576
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb on lines 338..370

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 125.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                    ::Rule_names << def jasms_2002_2_e1_bprime(only_uniqs: true, fragment_adduct_state: :as_published)
                                      fragment_sets = []
                                      fragment = lambda do |*arr|
                                        # duplicate
                                        (nmol, (alcohol_oxygen, attacked_carbon, carbon_linker, nitrogen)) = self.dup_molecule(arr)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb and 1 other location - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb on lines 228..260

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 124.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                                    ::Rule_names << def jasms_2002_2_e1_b(only_uniqs: true, fragment_adduct_state: :as_published)
                                      fragment_sets = []
                                      fragment = lambda do |*arr|
                                        # duplicate
                                        (nmol, (alcohol_oxygen, nitrogen, attacked_carbon, leaving_oxygen)) = self.dup_molecule(arr)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb and 1 other location - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb on lines 264..296

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 124.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. 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: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb and 2 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 222..253
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 329..360

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 122.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 4 locations. 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)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb and 3 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 117..148
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 152..183
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 294..325

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 121.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Similar blocks of code found in 3 locations. 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: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb and 2 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 82..113
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 187..218

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 120.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              There are no issues that match your filters.

                              Category
                              Status