gavinlaking/vedeu

View on GitHub

Showing 67 of 67 total issues

Class Configuration has 42 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Configuration

    include Singleton

    class << self
Severity: Minor
Found in lib/vedeu/configuration/configuration.rb - About 5 hrs to fix

    Class API has 40 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class API
    
          include Vedeu::Common
    
          # @param (see #initialize)
    Severity: Minor
    Found in lib/vedeu/configuration/api.rb - About 5 hrs to fix

      Class DSL has 29 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class DSL
      
            include Vedeu::DSL
            include Vedeu::DSL::Border
            include Vedeu::DSL::Presentation
      Severity: Minor
      Found in lib/vedeu/borders/dsl.rb - About 3 hrs to fix

        Class Cursor has 24 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Cursor
        
              include Vedeu::Repositories::Model
              include Vedeu::Toggleable
              extend Forwardable
        Severity: Minor
        Found in lib/vedeu/cursors/cursor.rb - About 2 hrs to fix

          Class Document has 23 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class Document
          
                include Vedeu::Repositories::Defaults
                include Vedeu::Repositories::Model
                extend Forwardable
          Severity: Minor
          Found in lib/vedeu/editor/document.rb - About 2 hrs to fix

            Class Alignment has 22 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class Alignment
            
                  include Vedeu::Common
            
                  # @!attribute [r] value
            Severity: Minor
            Found in lib/vedeu/coercers/alignment.rb - About 2 hrs to fix

              Class Attributes has 21 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class Attributes
              
                    include Vedeu::Common
              
                    # @param (see #initialize)
              Severity: Minor
              Found in lib/vedeu/dsl/helpers/attributes.rb - About 2 hrs to fix

                Class Move has 21 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class Move
                
                      include Vedeu::Repositories::Defaults
                      extend Forwardable
                
                
                Severity: Minor
                Found in lib/vedeu/geometries/move.rb - About 2 hrs to fix

                  Method coerce has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def coerce(collection = [], parent = nil, name = nil)
                            if collection.is_a?(Vedeu::Views::Streams)
                              collection
                  
                            elsif array?(collection)
                  Severity: Minor
                  Found in lib/vedeu/views/streams.rb - About 2 hrs 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 coerce has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def coerce(collection = [], parent = nil, name = nil)
                            if collection.is_a?(Vedeu::Views::Chars)
                              collection
                  
                            elsif array?(collection)
                  Severity: Minor
                  Found in lib/vedeu/views/chars.rb - About 1 hr 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

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

                    module Colours
                  
                      # The class represents one half (the other, can be found at
                      # {Vedeu::Colours::Background}) of a terminal colour escape
                      # sequence.
                  Severity: Major
                  Found in lib/vedeu/colours/foreground.rb and 1 other location - About 1 hr to fix
                  lib/vedeu/colours/background.rb on lines 5..64

                  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 60.

                  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

                  Method attributes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                        def attributes
                          {
                            client:               client,
                            height:               @height.is_a?(Proc) ? @height.call : @height,
                            horizontal_alignment: horizontal_alignment,
                  Severity: Minor
                  Found in lib/vedeu/geometries/geometry.rb - About 1 hr 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 coerce has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                          def coerce(collection = [], parent = nil, name = nil)
                            if collection.is_a?(Vedeu::Views::Lines)
                              collection
                  
                            elsif collection.is_a?(Vedeu::Views::Streams)
                  Severity: Minor
                  Found in lib/vedeu/views/lines.rb - About 1 hr 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

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

                    module Colours
                  
                      # The class represents one half (the other, can be found at
                      # {Vedeu::Colours::Foreground}) of a terminal colour escape
                      # sequence.
                  Severity: Major
                  Found in lib/vedeu/colours/background.rb and 1 other location - About 1 hr to fix
                  lib/vedeu/colours/foreground.rb on lines 5..64

                  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 60.

                  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

                  Method defaults has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def defaults
                        {
                          background:    :default,
                          base_path:     base_path,
                          colour_mode:   detect_colour_mode,
                  Severity: Minor
                  Found in lib/vedeu/configuration/configuration.rb - About 1 hr to fix

                    Method coerce has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def coerce
                            if coerced?
                              value
                    
                            elsif hash?(value)
                    Severity: Minor
                    Found in lib/vedeu/coercers/style.rb - About 1 hr 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 read has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                          def read
                            Vedeu.log(type: :input, message: "Waiting for user input...\n")
                    
                            if raw_mode?
                              Vedeu.trigger(:_keypress_, keypress)
                    Severity: Minor
                    Found in lib/vedeu/input/capture.rb - About 1 hr 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 coerce has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            def coerce(collection = [], parent = nil, name = nil)
                              if collection.is_a?(Vedeu::Views::Streams)
                                collection
                    
                              elsif array?(collection)
                    Severity: Minor
                    Found in lib/vedeu/views/streams.rb - About 1 hr to fix

                      Method parse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def parse
                              lines_collection = Vedeu::Views::Lines.new
                      
                              lines.each do |line|
                                line_object = Vedeu::Views::Line.new
                      Severity: Minor
                      Found in lib/vedeu/templating/view_template.rb - About 55 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 loggable? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def loggable?(type)
                              return false unless log?
                              return false unless Vedeu::LOG_TYPES_KEYS.include?(type)
                              return true  if log_only.empty? && log_except.empty?
                      
                      
                      Severity: Minor
                      Found in lib/vedeu/configuration/configuration.rb - About 55 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