Showing 8 of 10 total issues

Method untrack_changes_in_object has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

      def untrack_changes_in_object(object)
        is_tracked = object.instance_variable_defined?('@fie_tracked')

        if is_tracked
          object.methods.each do |attribute_name, attribute_value|
Severity: Minor
Found in lib/fie/state/track.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 track_changes_in_object has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

      def track_changes_in_object(object)
        state = self
        is_untracked = !object.instance_variable_defined?('@fie_tracked')

        if is_untracked
Severity: Minor
Found in lib/fie/state/track.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 track_changes_in_array has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def track_changes_in_array(object)
        state = self

        unless object.frozen?
          object.class_eval do
Severity: Minor
Found in lib/fie/state/track.rb - About 1 hr to fix

    Function processCommand has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      processCommand(command, parameters = {}) {
        switch(command) {
          case 'refresh_view':
            innerHTML(document.querySelector('[fie-body=true]'), parameters.html);
            const event = new Event(this.eventName);
    Severity: Minor
    Found in lib/javascript/fie/commander.js - About 1 hr to fix

      Function _diffSetup has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

        _diffSetup() {
          polyfill();
      
          use(
            Object.assign(_ => {}, {
      Severity: Minor
      Found in lib/javascript/fie.js - 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 traverse has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def traverse(changelog:, object:, node_name:, changelog_node:)
              if object.is_a?(Array)
                node_name = node_name.to_i
                object_node = object[node_name]
              elsif object.is_a?(Hash)
      Severity: Minor
      Found in lib/fie/state/changelog.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 update_object_value has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

            def update_object_value(object:, node_name:, value:)
              if object.is_a?(Array)
                node_name = node_name.to_i
                object[node_name] = value
              elsif object.is_a?(Hash)
      Severity: Minor
      Found in lib/fie/state/changelog.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 update_object_using_changelog has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def update_object_using_changelog(changelog, object = self)
            unless changelog.blank?
              changelog.each do |node_name, _|
                changelog_node = changelog[node_name]
                is_not_end_of_tree = changelog_node.is_a? Hash
      Severity: Minor
      Found in lib/fie/state/changelog.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