princelab/msplinter

View on GitHub
lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb

Summary

Maintainability
F
6 days
Test Coverage

File asms_2002_scheme3-5.rb has 412 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_scheme3-5.rb - About 5 hrs to fix

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

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

            ::Rule_names << def jasms_2002_4_g2a_formaldehyde_loss(only_uniqs: true, fragment_adduct_state: :as_published)
              fragment_sets = []
              fragment = lambda do |*arr|
                # duplicate
                (nmol, (ring_carbon, ring_oxygen, c3, link_carbon)) = 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_5_e2_water_loss has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

                ::Rule_names << def jasms_2002_3_b2(only_uniqs: true, fragment_adduct_state: :as_published)
                  fragment_sets = []
                  fragment = lambda do |*arr|
                    # duplicate
                    (nmol, (alcc1, alco1, alcc2, alco2)) = 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 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)
            Severity: Minor
            Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb - About 1 hr to fix

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

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

                      ::Rule_names << def jasms_2002_4_g1(only_uniqs: true, fragment_adduct_state: :as_published)
                        fragment_sets = []
                        fragment = lambda do |*arr|
                          # duplicate
                          (nmol, (alcohol_oxygen, alcohol_carbon, c1)) = 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_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)
                  Severity: Minor
                  Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb - About 1 hr to fix

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

                          ::Rule_names << def jasms_2002_3_b2_water_loss(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_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

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

                                    ::Rule_names << def jasms_2002_5_e5_formaldehyde_loss(only_uniqs: true, fragment_adduct_state: :as_published)
                                      fragment_sets = []
                                      fragment = lambda do |*arr|
                                        # duplicate
                                        (nmol, (nitrogen, ring_carbon, lost_carbon, lost_oxygen, ring_carbon2)) = self.dup_molecule(arr)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.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_scheme2.rb on lines 190..224

                              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_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: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb and 2 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb on lines 47..78
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 222..253

                              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 3 locations. 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)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb and 2 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb on lines 47..78
                              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

                                    ::Rule_names << def jasms_2002_4_g1(only_uniqs: true, fragment_adduct_state: :as_published)
                                      fragment_sets = []
                                      fragment = lambda do |*arr|
                                        # duplicate
                                        (nmol, (alcohol_oxygen, alcohol_carbon, c1)) = self.dup_molecule(arr)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb and 3 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb on lines 117..148
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb on lines 117..148
                              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 4 locations. 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: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb and 3 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.rb on lines 117..148
                              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

                              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 4 locations. 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)
                              Severity: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb and 3 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.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_3_b2_water_loss(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: Major
                              Found in lib/rubabel/molecule/fragmentable/asms_2002_scheme3-5.rb and 2 other locations - About 3 hrs to fix
                              lib/rubabel/molecule/fragmentable/asms_2002_scheme2.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

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

                              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