Showing 10 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

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

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

      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

      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

      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

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

      def untrack_changes_in_objects(object)
      if object.is_a? Hash
      untrack_changes_in_hash(object)
      elsif object.is_a? Array
      untrack_changes_in_array(object)
      Severity: Minor
      Found in lib/fie/state/track.rb and 1 other location - About 25 mins to fix
      lib/fie/state/track.rb on lines 3..12

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

      def track_changes_in_objects(object)
      if object.is_a?(Array)
      track_changes_in_array(object)
      elsif object.is_a?(Hash)
      track_changes_in_hash(object)
      Severity: Minor
      Found in lib/fie/state/track.rb and 1 other location - About 25 mins to fix
      lib/fie/state/track.rb on lines 15..24
      Severity
      Category
      Status
      Source
      Language