nutella-framework/nutella_framework

View on GitHub

Showing 96 of 196 total issues

Function request_to_run has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

FRNetSubModule.prototype.request_to_run = function( app_id, run_id, channel, request, callback) {
Severity: Minor
Found in framework_components/room-debugger/js/nutella_lib.js - About 35 mins to fix

Function upload has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function upload(file_mngr_url, file, filename, success, error) {
Severity: Minor
Found in framework_components/room-debugger/js/nutella_lib.js - About 35 mins to fix

Method run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def run( args=nil )

      # First check that we have all the tools we need to run nutella
      return unless all_dependencies_installed?
      
Severity: Minor
Found in lib/commands/checkup.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

Avoid too many return statements within this function.
Open

    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
Severity: Major
Found in framework_components/room-debugger/js/bootstrap.js - About 30 mins to fix

Avoid too many return statements within this method.
Open

      return unless Nutella.runlist.add?(app_id, run_id, app_path)
Severity: Major
Found in lib/commands/start.rb - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return false
Severity: Major
Found in framework_components/room-debugger/js/bootstrap.js - About 30 mins to fix

Avoid too many return statements within this method.
Open

      return unless start_all_components(app_id, app_path, run_id, params)
Severity: Major
Found in lib/commands/start.rb - About 30 mins to fix

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

  def self.start_mode(params)
    return :WITH unless params[:with].empty?
    return :WO unless params[:without].empty?
    :ALL if params[:with].empty? && params[:without].empty?
  end
Severity: Minor
Found in lib/commands/util/components_list.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 handle_requests_on_all_runs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def self.handle_requests_on_all_runs(channel, callback)
        # Check the passed callback has the right number of arguments
        raise 'You need to pass a callback with 4 parameters (request, run_id, from) when handling requests!' if callback.parameters.length!=4
        # Pad channel
        padded_channel = Nutella::Net.pad_channel(channel, '+', '+')
Severity: Minor
Found in nutella_lib/framework_net.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 compile_and_dependencies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def compile_and_dependencies( script , in_progress_message, complete_message)
      # If the current directory is not a nutella application, return
      unless Nutella.current_app.exist?
        console.warn 'The current directory is not a nutella application'
        return
Severity: Minor
Found in lib/commands/meta/run_command.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

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

RoomPlacesSimulator.prototype.start = function() {
    // Assign initial location
    var hotspots = this.hotspots;
    this.beacons.forEach((function(e,i) {
        e.l = hotspots[Math.floor(Math.random()*hotspots.length)];
Severity: Minor
Found in framework_components/room-debugger/room_places_simulator.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 handle_requests_on_all_apps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def self.handle_requests_on_all_apps(channel, callback)
        # Check the passed callback has the right number of arguments
        raise 'You need to pass a callback with 3 parameters (request, run_id, from) when handling requests!' if callback.parameters.length!=3
        # Pad channel
        padded_channel = Nutella::Net.pad_channel(channel, '+', nil)
Severity: Minor
Found in nutella_lib/framework_net.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 exist? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def CurrentAppUtils.exist?
      cur_app_dir = Dir.pwd
      nutella_json_file = "#{cur_app_dir}/nutella.json"
      # Check that there is a nutella.json file in the main directory of the application
      if File.exist? nutella_json_file
Severity: Minor
Found in lib/config/current_app_utils.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def run(args=nil)

      # If the current directory is not a nutella application, return
      unless Nutella.current_app.exist?
        console.warn 'The current directory is not a nutella application'
Severity: Minor
Found in lib/commands/stop.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 parse_run_id_from has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def parse_run_id_from( args )
      # Simple `nutella start/stop` (no args)
      if args.nil? || args.empty?
        return 'default'
      end
Severity: Minor
Found in lib/commands/meta/run_command.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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def run(args=nil)

      # If invoked with "all" it will show all the runs under this instance of nutella
      if args[0]=='--all' || args[0]=='-a'
        display_all_runs
Severity: Minor
Found in lib/commands/runs.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