XYOracleNetwork/sdk-ble-flutter

View on GitHub

Showing 226 of 312 total issues

Method dynamicMethod has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @java.lang.Override
    @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
    protected final java.lang.Object dynamicMethod(
        com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
        java.lang.Object arg0, java.lang.Object arg1) {

    Method dynamicMethod has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @java.lang.Override
        @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
        protected final java.lang.Object dynamicMethod(
            com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
            java.lang.Object arg0, java.lang.Object arg1) {

      Method dynamicMethod has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @java.lang.Override
          @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
          protected final java.lang.Object dynamicMethod(
              com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
              java.lang.Object arg0, java.lang.Object arg1) {

        Method dynamicMethod has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            @java.lang.Override
            @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
            protected final java.lang.Object dynamicMethod(
                com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                java.lang.Object arg0, java.lang.Object arg1) {

          Method dynamicMethod has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @java.lang.Override
              @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
              protected final java.lang.Object dynamicMethod(
                  com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                  java.lang.Object arg0, java.lang.Object arg1) {

            Method dynamicMethod has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  @java.lang.Override
                  @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                  protected final java.lang.Object dynamicMethod(
                      com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                      java.lang.Object arg0, java.lang.Object arg1) {

              Method dynamicMethod has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @java.lang.Override
                  @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                  protected final java.lang.Object dynamicMethod(
                      com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                      java.lang.Object arg0, java.lang.Object arg1) {

                Method dynamicMethod has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      @java.lang.Override
                      @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                      protected final java.lang.Object dynamicMethod(
                          com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                          java.lang.Object arg0, java.lang.Object arg1) {

                  Method dynamicMethod has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @java.lang.Override
                      @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                      protected final java.lang.Object dynamicMethod(
                          com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                          java.lang.Object arg0, java.lang.Object arg1) {

                    Method dynamicMethod has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @java.lang.Override
                        @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                        protected final java.lang.Object dynamicMethod(
                            com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                            java.lang.Object arg0, java.lang.Object arg1) {

                      Method dynamicMethod has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          @java.lang.Override
                          @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                          protected final java.lang.Object dynamicMethod(
                              com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                              java.lang.Object arg0, java.lang.Object arg1) {

                        Method dynamicMethod has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @java.lang.Override
                            @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                            protected final java.lang.Object dynamicMethod(
                                com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                                java.lang.Object arg0, java.lang.Object arg1) {

                          Method dynamicMethod has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              @java.lang.Override
                              @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                              protected final java.lang.Object dynamicMethod(
                                  com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                                  java.lang.Object arg0, java.lang.Object arg1) {

                            Method dynamicMethod has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                @java.lang.Override
                                @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
                                protected final java.lang.Object dynamicMethod(
                                    com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
                                    java.lang.Object arg0, java.lang.Object arg1) {

                              Function runCall has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  static func runCall(for device: XYBluetoothDevice, operation: GattOperation) -> XYBluetoothResult {
                                      var bleResult: XYBluetoothResult
                              
                                      if let selectedOp = operation.operation {
                                          switch selectedOp {
                              Severity: Minor
                              Found in ios/Classes/GattRequestHandler.swift - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Function process has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  static func process(for device: XYBluetoothDevice, operation: DefinedOperation) -> XYBluetoothResult {
                                      if let xyDevice = self.deviceAsFinder(device) {
                                          switch operation {
                                          case .song:
                                              _ = xyDevice.unlock()
                              Severity: Minor
                              Found in ios/Classes/GattDefinedOperationRequest.swift - About 1 hr to fix

                                Method getHumanBoundWitnessName has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    // todo find way to localise strings with flutter
                                    fun getHumanBoundWitnessName(boundWitness: XyoBoundWitness, publicKey: ByteArray?): String {
                                        if (boundWitness.numberOfParties == 1) {
                                            if (getIndexForParty(boundWitness, 0) == 0) {
                                                return "First block!"

                                  Function getHumanHeuristics has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      static func getHumanHeuristics(boundWitness: XyoBoundWitness) -> [String: String] {
                                          do {
                                              var returnArray: [String: String] = [:]
                                              guard let numberOfParties = try boundWitness.getNumberOfParties() else {
                                                  return [:]
                                  Severity: Minor
                                  Found in ios/Classes/XyoHumanHeuristics.swift - About 1 hr to fix

                                  Cognitive Complexity

                                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                  A method's cognitive complexity is based on a few simple rules:

                                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                  • Code is considered more complex for each "break in the linear flow of the code"
                                  • Code is considered more complex when "flow breaking structures are nested"

                                  Further reading

                                  Method fromBase58 has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  /**
                                   * Decodes the base58 string into a [ByteArray]
                                   *
                                   * @return the decoded data bytes
                                   * @throws NumberFormatException if the string is not a valid base58 string
                                  Severity: Minor
                                  Found in android/src/main/kotlin/network/xyo/ble/xyo_ble/Base58.kt - About 1 hr to fix

                                    Function handle has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
                                            guard let method = MethodRegistry(rawValue: call.method) else {
                                                result(nil)
                                                return
                                            }
                                    Severity: Minor
                                    Found in ios/Classes/SwiftXyoBlePlugin.swift - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language