Muriel-Salvan/ruby-serial

View on GitHub

Showing 24 of 26 total issues

Avoid too many return statements within this method.
Open

              return decoded_obj
Severity: Major
Found in lib/ruby-serial/versions/1/deserializer.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                  return {
                    OBJECT_CLASSNAME_REFERENCE => CLASS_ID_RANGE,
                    OBJECT_CONTENT_REFERENCE => [get_msgpack_compatible_rec(obj.first), get_msgpack_compatible_rec(obj.last), obj.exclude_end?]
                  }
    Severity: Major
    Found in lib/ruby-serial/versions/1/serializer.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                    return container_to_fill
      Severity: Major
      Found in lib/ruby-serial/versions/1/deserializer.rb - About 30 mins to fix

        Method instance_vars_to_be_rubyserialized has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          def instance_vars_to_be_rubyserialized
            # Compute the list of attributes to serialize
            instance_var_names = []
            klass = self.class
            if !klass.rubyserial_only_lst.nil?
        Severity: Minor
        Found in lib/ruby-serial/_object.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