OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

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

  cmd_no_range_check(target_name, command_name, param_list) {
    if (command_name === undefined) {
      return this.exec('cmd_no_range_check', target_name)
    } else {
      return this._cmd(
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 8 other locations - About 50 mins to fix
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 404..415
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 444..450
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 452..463
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 465..476
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 478..484
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 486..497
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 499..510
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 512..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  cmd_no_checks(target_name, command_name, param_list) {
    if (command_name === undefined) {
      return this.exec('cmd_no_checks', target_name)
    } else {
      return this._cmd('cmd_no_checks', target_name, command_name, param_list)
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 8 other locations - About 50 mins to fix
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 404..415
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 431..442
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 444..450
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 452..463
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 465..476
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 486..497
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 499..510
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 512..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  cmd_no_hazardous_check(target_name, command_name, param_list) {
    if (command_name === undefined) {
      return this.exec('cmd_no_hazardous_check', target_name)
    } else {
      return this._cmd(
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 8 other locations - About 50 mins to fix
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 404..415
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 431..442
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 444..450
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 452..463
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 478..484
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 486..497
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 499..510
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 512..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      begin
        pypi_url = get_setting('pypi_url', scope: scope)
        if pypi_url
          pypi_url += '/simple'
        end
Severity: Minor
Found in openc3/lib/openc3/models/python_package_model.rb and 1 other location - About 50 mins to fix
openc3/lib/openc3/models/plugin_model.rb on lines 184..199

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 43.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  cmd_raw_no_range_check(target_name, command_name, param_list) {
    if (command_name === undefined) {
      return this.exec('cmd_raw_no_range_check', target_name)
    } else {
      return this._cmd(
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 8 other locations - About 50 mins to fix
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 404..415
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 431..442
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 444..450
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 465..476
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 478..484
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 486..497
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 499..510
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 512..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  cmd_raw_no_hazardous_check(target_name, command_name, param_list) {
    if (command_name === undefined) {
      return this.exec('cmd_raw_no_hazardous_check', target_name)
    } else {
      return this._cmd(
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 8 other locations - About 50 mins to fix
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 404..415
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 431..442
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 444..450
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 452..463
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 465..476
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 478..484
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 499..510
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 512..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  cmd_raw_no_checks(target_name, command_name, param_list) {
    if (command_name === undefined) {
      return this.exec('cmd_raw_no_checks', target_name)
    } else {
      return this._cmd(
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 8 other locations - About 50 mins to fix
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 404..415
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 431..442
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 444..450
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 452..463
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 465..476
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 478..484
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 486..497
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 512..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

          begin
            pypi_url = get_setting('pypi_url', scope: scope)
            if pypi_url
              pypi_url += '/simple'
            end
Severity: Minor
Found in openc3/lib/openc3/models/plugin_model.rb and 1 other location - About 50 mins to fix
openc3/lib/openc3/models/python_package_model.rb on lines 77..92

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 43.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  cmd_raw(target_name, command_name, param_list) {
    if (command_name === undefined) {
      return this.exec('cmd_raw', target_name)
    } else {
      return this._cmd('cmd_raw', target_name, command_name, param_list)
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 8 other locations - About 50 mins to fix
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 404..415
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 431..442
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 452..463
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 465..476
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 478..484
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 486..497
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 499..510
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 512..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  get_cmd_hazardous(target_name, command_name, param_list) {
    if (command_name === undefined) {
      return this.exec('get_cmd_hazardous', target_name)
    } else {
      return this._cmd(
Severity: Major
Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 8 other locations - About 50 mins to fix
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 431..442
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 444..450
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 452..463
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 465..476
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 478..484
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 486..497
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 499..510
openc3/templates/tool_svelte/src/services/openc3-api.js on lines 512..518

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 52.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def deploy_critical_cmd_microservice(gem_path, variables, parent)
      microservice_name = "#{@scope}__CRITICALCMD__#{@scope}"
      microservice = MicroserviceModel.new(
        name: microservice_name,
        cmd: ["ruby", "critical_cmd_microservice.rb", microservice_name],
Severity: Major
Found in openc3/lib/openc3/models/scope_model.rb and 2 other locations - About 50 mins to fix
openc3/lib/openc3/models/scope_model.rb on lines 249..261
openc3/lib/openc3/models/scope_model.rb on lines 264..276

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def stop_raw_logging_interface(interface_name = 'ALL', manual: false, scope: $openc3_scope, token: $openc3_token)
      # TODO: Check if they have command authority for the targets mapped to this interface
      authorize(permission: 'system_set', interface_name: interface_name, manual: manual, scope: scope, token: token)
      if interface_name == 'ALL'
        get_interface_names().each do |interface_name|
Severity: Major
Found in openc3/lib/openc3/api/interface_api.rb and 3 other locations - About 50 mins to fix
openc3/lib/openc3/api/interface_api.rb on lines 84..92
openc3/lib/openc3/api/router_api.rb on lines 82..90
openc3/lib/openc3/api/router_api.rb on lines 97..105

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def start_raw_logging_interface(interface_name = 'ALL', manual: false, scope: $openc3_scope, token: $openc3_token)
      # TODO: Check if they have command authority for the targets mapped to this interface
      authorize(permission: 'system_set', interface_name: interface_name, manual: manual, scope: scope, token: token)
      if interface_name == 'ALL'
        get_interface_names().each do |interface_name|
Severity: Major
Found in openc3/lib/openc3/api/interface_api.rb and 3 other locations - About 50 mins to fix
openc3/lib/openc3/api/interface_api.rb on lines 99..107
openc3/lib/openc3/api/router_api.rb on lines 82..90
openc3/lib/openc3/api/router_api.rb on lines 97..105

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def deploy_periodic_microservice(gem_path, variables, parent)
      microservice_name = "#{@scope}__PERIODIC__#{@scope}"
      microservice = MicroserviceModel.new(
        name: microservice_name,
        cmd: ["ruby", "periodic_microservice.rb", microservice_name],
Severity: Major
Found in openc3/lib/openc3/models/scope_model.rb and 2 other locations - About 50 mins to fix
openc3/lib/openc3/models/scope_model.rb on lines 264..276
openc3/lib/openc3/models/scope_model.rb on lines 279..291

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        case reduced_type
        when :AVG
          value = @json_hash["#{name}__A"]
        when :STDDEV
          value = @json_hash["#{name}__S"]
Severity: Minor
Found in openc3/lib/openc3/packets/json_packet.rb and 1 other location - About 50 mins to fix
openc3/lib/openc3/packets/json_packet.rb on lines 82..90

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def deploy_scopecleanup_microservice(gem_path, variables, parent)
      microservice_name = "#{@scope}__SCOPECLEANUP__#{@scope}"
      microservice = MicroserviceModel.new(
        name: microservice_name,
        cmd: ["ruby", "scope_cleanup_microservice.rb", microservice_name],
Severity: Major
Found in openc3/lib/openc3/models/scope_model.rb and 2 other locations - About 50 mins to fix
openc3/lib/openc3/models/scope_model.rb on lines 249..261
openc3/lib/openc3/models/scope_model.rb on lines 279..291

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        if stderr.length > 0
          message = "STDERR #{stderr.length} bytes from #{cmd_line()}:"
          STDERR.puts Logger.build_log_data(Logger::ERROR_LEVEL, message, user: nil, type: OpenC3::Logger::LOG, url: nil).as_json(:allow_nan => true).to_json(:allow_nan => true)
          STDERR.puts stderr
Severity: Minor
Found in openc3/lib/openc3/operators/operator.rb and 1 other location - About 50 mins to fix
openc3/lib/openc3/operators/operator.rb on lines 197..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

          case reduced_type
          when :AVG
            value = @json_hash["#{name}__CA"]
          when :STDDEV
            value = @json_hash["#{name}__CS"]
Severity: Minor
Found in openc3/lib/openc3/packets/json_packet.rb and 1 other location - About 50 mins to fix
openc3/lib/openc3/packets/json_packet.rb on lines 97..105

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        if stdout.length > 0
          message = "STDOUT #{stdout.length} bytes from #{cmd_line()}:"
          STDOUT.puts Logger.build_log_data(Logger::INFO_LEVEL, message, user: nil, type: OpenC3::Logger::LOG, url: nil).as_json(:allow_nan => true).to_json(:allow_nan => true)
          STDOUT.puts stdout
Severity: Minor
Found in openc3/lib/openc3/operators/operator.rb and 1 other location - About 50 mins to fix
openc3/lib/openc3/operators/operator.rb on lines 203..206

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    def stop_raw_logging_router(router_name = 'ALL', manual: false, scope: $openc3_scope, token: $openc3_token)
      # TODO: Check if they have command authority for the targets mapped to this interface
      authorize(permission: 'system_set', router_name: router_name, manual: manual, scope: scope, token: token)
      if router_name == 'ALL'
        get_router_names().each do |router_name|
Severity: Major
Found in openc3/lib/openc3/api/router_api.rb and 3 other locations - About 50 mins to fix
openc3/lib/openc3/api/interface_api.rb on lines 84..92
openc3/lib/openc3/api/interface_api.rb on lines 99..107
openc3/lib/openc3/api/router_api.rb on lines 82..90

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 42.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language