netzke/netzke-core

View on GitHub

Showing 15 of 15 total issues

`` has 37 functions (exceeds 20 allowed). Consider refactoring.
Open

Ext.define("Netzke.Base", {
  extend: 'Ext.Mixin',

  mixinConfig: {
    before: {
Severity: Minor
Found in javascripts/base.js - About 4 hrs to fix

    File base.js has 327 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Client-side code for [Netzke::Base](http://www.rubydoc.info/github/netzke/netzke-core/Netzke/Base)
     * @class Netzke.Base
     */
    Ext.define("Netzke.Base", {
    Severity: Minor
    Found in javascripts/base.js - About 3 hrs to fix

      Function netzkeProcessDeliveredComponent has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

        netzkeProcessDeliveredComponent: function(container, result, params){
          var config = result.config, instance, doNotInsert, currentInstance;
          config.netzkeParent = this;
      
          this.netzkeEvalJs(result.js);
      Severity: Minor
      Found in javascripts/base.js - 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

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

          class ClientClassConfig
            attr_accessor :base_class, :properties, :translated_properties, :dir, :requires_as_string
      
            def initialize(klass, called_from)
              @klass = klass
      Severity: Minor
      Found in lib/netzke/core/client_class_config.rb - About 2 hrs to fix

        Function netzkeBulkExecute has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

          netzkeBulkExecute : function(instructions){
            if (Ext.isArray(instructions)) {
              Ext.each(instructions, function(instruction){ this.netzkeBulkExecute(instruction)}, this);
            } else {
              for (var instr in instructions) {
        Severity: Minor
        Found in javascripts/base.js - 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 netzke_deep_replace has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          def netzke_deep_replace(&block)
            self.dup.tap do |h|
              h.each_pair do |k,v|
                if v.is_a?(Hash)
                  res = yield(v)
        Severity: Minor
        Found in lib/netzke/core/ruby_ext/hash.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 detect_and_normalize_component has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def detect_and_normalize_component(item)
              item = {component: item} if item.is_a?(Symbol) && respond_to?(:"#{item}_component")
              return item unless item.is_a?(Hash)
              return nil if item[:excluded]
        
        
        Severity: Minor
        Found in lib/netzke/core/composition.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

        Function netzkeProcessDirectResponse has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

          netzkeProcessDirectResponse: function(response, event, callback, scope){
            var callbackParams,
                result; // endpoint response
        
            // no server exception?
        Severity: Minor
        Found in javascripts/base.js - 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

        Function camelize has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        if (!String.prototype.camelize) String.prototype.camelize = function(lowFirstLetter)
        {
          var str=this; //.toLowerCase();
          var str_path=str.split('/');
          for(var i=0;i<str_path.length;i++)
        Severity: Minor
        Found in javascripts/js_extensions.js - 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

        Avoid deeply nested control flow statements.
        Open

                  if (Ext.isArray(cfg[key])) {
                    this.netzkeNormalizeConfigArray(cfg[key]);
                  }
        Severity: Major
        Found in javascripts/base.js - About 45 mins to fix

          Method invoke_endpoint has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def invoke_endpoint(endpoint, params, configs = [])
                self.client = Netzke::Core::EndpointResponse.new
          
                if has_endpoint?(endpoint)
                  client.netzke_set_result(send("#{endpoint}_endpoint", *params))
          Severity: Minor
          Found in lib/netzke/core/services.rb - About 45 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 netzke_deep_replace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def netzke_deep_replace(&block)
              self.map do |el|
                res = yield(el)
                if res == el
                  el.respond_to?(:netzke_deep_replace) ? el.netzke_deep_replace(&block) : el
          Severity: Minor
          Found in lib/netzke/core/ruby_ext/array.rb - About 35 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 netzke_jsonify has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def netzke_jsonify
              self.inject({}) do |h,(k,v)|
                new_key = if k.is_a?(Netzke::Core::JsonLiteral)
                            k
                          elsif k.is_a?(String)
          Severity: Minor
          Found in lib/netzke/core/ruby_ext/hash.rb - About 35 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 detect_and_normalize_action has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def detect_and_normalize_action(item)
                item = {action: item} if item.is_a?(Symbol) && actions[item]
          
                if action_name = action_name_if_action(item)
                  action_config = actions[action_name]
          Severity: Minor
          Found in lib/netzke/core/actions.rb - About 35 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 method_missing has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def method_missing(name, *params)
                if name.to_s =~ /(.+)=$/
                  self[$1.to_sym] = params.first
                else
                  self[name] = self.class.new if self[name].nil?
          Severity: Minor
          Found in lib/netzke/core/endpoint_response.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