OpenC3/cosmos

View on GitHub

Showing 1,379 of 1,379 total issues

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

    def set_tlm(*args, type: :ALL, scope: $openc3_scope, token: $openc3_token)
      if args.length == 1
        puts "set_tlm(\"#{args.join('')}\", type: #{type})"
      else
        puts "set_tlm(\"#{args.join('", "')}\", type: #{type})"
Severity: Major
Found in openc3/lib/openc3/script/telemetry.rb and 2 other locations - About 55 mins to fix
openc3/lib/openc3/script/telemetry.rb on lines 62..68
openc3/lib/openc3/script/telemetry.rb on lines 71..77

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

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 normalize_tlm(*args, type: :ALL, scope: $openc3_scope, token: $openc3_token)
      if args.length == 1
        puts "normalize_tlm(\"#{args.join('')}\", type: #{type})"
      else
        puts "normalize_tlm(\"#{args.join('", "')}\", type: #{type})"
Severity: Major
Found in openc3/lib/openc3/script/telemetry.rb and 2 other locations - About 55 mins to fix
openc3/lib/openc3/script/telemetry.rb on lines 53..59
openc3/lib/openc3/script/telemetry.rb on lines 62..68

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

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 override_tlm(*args, type: :ALL, scope: $openc3_scope, token: $openc3_token)
      if args.length == 1
        puts "override_tlm(\"#{args.join('')}\", type: #{type})"
      else
        puts "override_tlm(\"#{args.join('", "')}\", type: #{type})"
Severity: Major
Found in openc3/lib/openc3/script/telemetry.rb and 2 other locations - About 55 mins to fix
openc3/lib/openc3/script/telemetry.rb on lines 53..59
openc3/lib/openc3/script/telemetry.rb on lines 71..77

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

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

      loop do
        begin
          bytes_sent = @handle.write_nonblock(data_to_send)
        rescue Errno::EAGAIN, Errno::EWOULDBLOCK
          result = IO.fast_select(nil, [@handle], nil, @write_timeout)
Severity: Minor
Found in openc3/lib/openc3/io/posix_serial_driver.rb and 1 other location - About 55 mins to fix
openc3/lib/openc3/streams/tcpip_socket_stream.rb on lines 123..140

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

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

    def get_interface(interface_name, manual: false, scope: $openc3_scope, token: $openc3_token)
      authorize(permission: 'system', interface_name: interface_name, manual: manual, scope: scope, token: token)
      interface = InterfaceModel.get(name: interface_name, scope: scope)
      raise "Interface '#{interface_name}' does not exist" unless interface

Severity: Minor
Found in openc3/lib/openc3/api/interface_api.rb and 1 other location - About 55 mins to fix
openc3/lib/openc3/api/router_api.rb on lines 46..51

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

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

    def get_router(router_name, manual: false, scope: $openc3_scope, token: $openc3_token)
      authorize(permission: 'system', router_name: router_name, manual: manual, scope: scope, token: token)
      router = RouterModel.get(name: router_name, scope: scope)
      raise "Router '#{router_name}' does not exist" unless router

Severity: Minor
Found in openc3/lib/openc3/api/router_api.rb and 1 other location - About 55 mins to fix
openc3/lib/openc3/api/interface_api.rb on lines 48..53

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

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

        loop do
          begin
            bytes_sent = @write_socket.write_nonblock(data_to_send)
          rescue Errno::EAGAIN, Errno::EWOULDBLOCK
            # Wait for the socket to be ready for writing or for the timeout
Severity: Minor
Found in openc3/lib/openc3/streams/tcpip_socket_stream.rb and 1 other location - About 55 mins to fix
openc3/lib/openc3/io/posix_serial_driver.rb on lines 117..131

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

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

Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(
Severity: Major
Found in openc3/python/openc3/script/web_socket_api.py - About 50 mins to fix

    Function wait_packet has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def wait_packet(
    Severity: Major
    Found in openc3/python/openc3/script/api_shared.py - About 50 mins to fix

      Function _cmd has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def _cmd(
      Severity: Major
      Found in openc3/python/openc3/script/commands.py - About 50 mins to fix

        Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(
        Severity: Major
        Found in openc3/python/openc3/script/web_socket_api.py - About 50 mins to fix

          Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(
          Severity: Major
          Found in openc3/python/openc3/script/web_socket_api.py - About 50 mins to fix

            Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def __init__(
            Severity: Major
            Found in openc3/python/openc3/script/web_socket_api.py - About 50 mins to fix

              Function wait_check_packet has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def wait_check_packet(
              Severity: Major
              Found in openc3/python/openc3/script/api_shared.py - About 50 mins to fix

                Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(
                Severity: Major
                Found in openc3/python/openc3/script/web_socket_api.py - About 50 mins to fix

                  Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      def __init__(
                  Severity: Major
                  Found in openc3/python/openc3/script/web_socket_api.py - About 50 mins to fix

                    Function define_item has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def define_item(
                    Severity: Major
                    Found in openc3/python/openc3/packets/structure.py - About 50 mins to fix

                      Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(
                      Severity: Major
                      Found in openc3/python/openc3/interfaces/protocols/fixed_protocol.py - About 50 mins to fix

                        Function wait_check_packet has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def wait_check_packet(
                        Severity: Major
                        Found in openc3/python/openc3/api/api_shared.py - About 50 mins to fix

                          Function __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(
                          Severity: Major
                          Found in openc3/python/openc3/interfaces/tcpip_client_interface.py - About 50 mins to fix
                            Severity
                            Category
                            Status
                            Source
                            Language