OpenC3/cosmos

View on GitHub
openc3/templates/tool_svelte/src/services/openc3-api.js

Summary

Maintainability
F
6 days
Test Coverage

Function exec has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  async exec(method, params, kwparams = {}, headerOptions = {}) {
    try {
      let refreshed = await OpenC3Auth.updateToken(
        OpenC3Auth.defaultMinValidity,
      )
Severity: Minor
Found in openc3/templates/tool_svelte/src/services/openc3-api.js - About 1 hr to fix

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

      async tlm(target_name, packet_name, item_name, value_type = 'CONVERTED') {
        let data = null
        // Check for the single string syntax: tlm("TGT PKT ITEM")
        if (packet_name === undefined) {
          data = await this.exec('tlm', [target_name])
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 1 day to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 333..360

    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 236.

    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

      async get_tlm_packet(target_name, packet_name, value_type, stale_time = 30) {
        const data = await this.exec('get_tlm_packet', [target_name, packet_name], {
          type: value_type,
          stale_time: stale_time,
        })
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 6 hrs to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 277..294

    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 157.

    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

      async hashString(string) {
        if (window.isSecureContext) {
          // Encode the string as an arrayBuffer which the subtle crypto API uses
          const arrayBuffer = new TextEncoder().encode(string)
          // Use the subtle crypto API to perform a SHA256 Sum of the array buffer
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 5 hrs to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 701..721

    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 143.

    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

      _cmd(method, target_name, command_name, param_list, headerOptions) {
        let converted = null
        for (let key in param_list) {
          if (Object.prototype.hasOwnProperty.call(param_list, key)) {
            converted = this.encode_openc3_type(param_list[key])
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 4 hrs to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 446..462

    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 119.

    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

      decode_openc3_type(val) {
        if (val !== null && typeof val === 'object') {
          if (val.json_class == 'Float' && val.raw) {
            if (val.raw == 'NaN') {
              return NaN
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 3 hrs to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 105..118

    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 114.

    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

      ensure_offline_access() {
        this.offline_access_needed().then((needed) => {
          if (needed) {
            if (localStorage.openc3OfflineToken) {
              this.set_offline_access(localStorage.openc3OfflineToken).then(() => {
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 3 hrs to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 131..143

    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 105.

    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

      encode_openc3_type(val) {
        if (Number.isNaN(val)) {
          return { json_class: 'Float', raw: 'NaN' }
        } else if (val == Number.POSITIVE_INFINITY) {
          return { json_class: 'Float', raw: 'Infinity' }
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 3 hrs to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 120..129

    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 101.

    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

        for (let i = 0; i < len; i++) {
          converted = this.decode_openc3_type(data[0][i])
          if (converted !== null) {
            data[0][i] = converted
          }
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 1 hr to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 320..325

    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 72.

    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 10 locations. Consider refactoring.
    Open

      cmd(target_name, command_name, param_list, headerOptions = {}) {
        if (command_name === undefined) {
          return this.exec('cmd', target_name, {}, headerOptions)
        } else {
          return this._cmd(
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 9 other locations - About 1 hr to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 464..476
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 478..490
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 492..509
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 511..523
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 525..542
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 544..561
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 563..575
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 577..599
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 601..613

    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 62.

    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

      connect_interface(interface_name, ...interface_params) {
        if (interface_params.length > 0) {
          return this.exec('connect_interface', [
            interface_name,
            ...interface_params,
    Severity: Major
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 1 hr to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 165..174

    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 62.

    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

      build_cmd(target_name, command_name, param_list) {
        if (command_name === undefined) {
          return this.exec('build_cmd', target_name)
        } else {
          return this._cmd('build_cmd', 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 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

    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_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

    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

    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

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

      async inject_tlm(
        target_name,
        packet_name,
        item_hash = null,
        value_type = 'CONVERTED',
    Severity: Minor
    Found in openc3/templates/tool_svelte/src/services/openc3-api.js and 1 other location - About 40 mins to fix
    openc3-cosmos-init/plugins/packages/openc3-tool-common/src/services/openc3-api.js on lines 362..375

    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 49.

    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

    There are no issues that match your filters.

    Category
    Status