From af3474f3ab80f6128ceb5579bc918dfd0e80ed4b Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 7 Jul 2023 10:11:41 -0400 Subject: [PATCH] [kotlin] Validate kotlin integration of detekt in #27661 (#27807) * Minor kotlin file change to validate we run detekt after #27661 * Fix indent error in detekt yaml * Add exceptions for existing classes for detekt * Restyled by whitespace * Restyled by prettier-yaml --------- Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io --- .github/workflows/kotlin-detekt.yaml | 22 +- kotlin-detect-config.yaml | 317 +++++++++++++++++++++++ src/controller/java/src/chip/tlv/tags.kt | 2 +- 3 files changed, 330 insertions(+), 11 deletions(-) create mode 100644 kotlin-detect-config.yaml diff --git a/.github/workflows/kotlin-detekt.yaml b/.github/workflows/kotlin-detekt.yaml index 1670b6def55d4f..4296edb438ffaa 100644 --- a/.github/workflows/kotlin-detekt.yaml +++ b/.github/workflows/kotlin-detekt.yaml @@ -6,15 +6,17 @@ on: - "**/*.kt" - ".github/workflows/kotlin-detekt.yaml" - jobs: - detekt: - runs-on: ubuntu-latest +jobs: + detekt: + runs-on: ubuntu-latest - steps: - - name: "checkout" - uses: actions/checkout@v2 + steps: + - name: "checkout" + uses: actions/checkout@v2 - - name: "detekt" - uses: natiginfo/action-detekt-all@1.23.0 - with: - args: --parallel --input examples/android/CHIPTest/,examples/android/CHIPTool,examples/java-matter-controller/java,src/controller/java + - name: "detekt" + uses: natiginfo/action-detekt-all@1.23.0 + # Detekt seems not to like circular symlinks, so we set up + # explicit paths below + with: + args: --parallel --build-upon-default-config --config kotlin-detect-config.yaml --input examples/android/CHIPTest,examples/android/CHIPTool,examples/java-matter-controller/java,src/controller/java diff --git a/kotlin-detect-config.yaml b/kotlin-detect-config.yaml new file mode 100644 index 00000000000000..868f7ea5966f8e --- /dev/null +++ b/kotlin-detect-config.yaml @@ -0,0 +1,317 @@ +# this is NOT a full configuration file, it is expected to be used +# with `--build-upon-default-config` +# +# Documentation at https://detekt.dev/docs/introduction/configurations + +# Exclude files with pre-existing issues BEFORE detect +# Ideally this should be driven down to 0 + +style: + MagicNumber: + excludes: + - "**/examples/android/CHIPTest/app/src/test/java/com/tcl/chip/chiptest/ExampleUnitTest.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/bluetooth/BluetoothManager.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/AddressUpdateFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/MultiAdminClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/AddressCommissioningFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/EnterNetworkFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImSubscribeCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/Main.kt" + - "**/src/controller/java/src/chip/jsontlv/JsonToTlv.kt" + - "**/src/controller/java/src/chip/onboardingpayload/Base38.kt" + - "**/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt" + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + - "**/src/controller/java/src/chip/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt" + - "**/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadGenerator.kt" + - "**/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt" + - "**/src/controller/java/src/chip/onboardingpayload/VendorId.kt" + - "**/src/controller/java/src/chip/tlv/tags.kt" + - "**/src/controller/java/src/chip/tlv/TlvWriter.kt" + - "**/src/controller/java/src/chip/tlv/types.kt" + - "**/src/controller/java/src/chip/tlv/utils.kt" + - "**/src/controller/java/src/chip/tlv/values.kt" + - "**/src/controller/java/src/chip/WildcardImport + examples/android/CHIPTest/app/src/androidTest/java/com/tcl/chip/chiptest/ExampleInstrumentedTest.kt" + - "**/src/controller/java/tests/chip/jsontlv/JsonToTlvToJsonTest.kt" + - "**/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt" + - "**/src/controller/java/tests/chip/tlv/TlvReaderTest.kt" + - "**/src/controller/java/tests/chip/tlv/TlvReadWriteTest.kt" + - "**/src/controller/java/tests/chip/tlv/TlvWriterTest.kt" + WildcardImport: + excludes: + - "**/examples/android/CHIPTest/app/src/androidTest/java/com/tcl/chip/chiptest/ExampleInstrumentedTest.kt" + - "**/examples/android/CHIPTest/app/src/main/java/com/tcl/chip/chiptest/MainActivity.kt" + - "**/examples/android/CHIPTest/app/src/test/java/com/tcl/chip/chiptest/ExampleUnitTest.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/MultiAdminClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/UnpairDeviceFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/SelectActionFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/Main.kt" + - "**/src/controller/java/src/chip/jsontlv/JsonToTlv.kt" + - "**/src/controller/java/src/chip/jsontlv/TlvToJson.kt" + - "**/src/controller/java/tests/chip/jsontlv/JsonToTlvToJsonTest.kt" + NewLineAtEndOfFile: + excludes: + - "**/examples/android/CHIPTest/app/src/androidTest/java/com/tcl/chip/chiptest/ExampleInstrumentedTest.kt" + - "**/examples/android/CHIPTest/app/src/test/java/com/tcl/chip/chiptest/ExampleUnitTest.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/AddressUpdateFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterInteractionFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterInteractionHistoryFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterInteractionSettingsFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/EndpointAdapter.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/EndpointItem.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/HistoryCommandAdapter.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/HistoryCommand.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Argument.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/ArgumentType.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Command.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/CredentialsIssuer.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/IPAddress.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/MatterCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/CloseSessionCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/DiscoveryFilterType.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairAddressPaseCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairAlreadyDiscoveredCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodeCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodePaseCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodeThreadCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodeWifiCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingModeType.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingNetworkType.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkCommissionerCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkCommissioningModeCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkDeviceTypeCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkFabricCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkInstanceNameCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImInvokeCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImWriteCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkShortCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkVendorCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/UnpairCommand.kt" + - "**/src/controller/java/src/chip/onboardingpayload/Verhoeff.kt" + MaxLineLength: + excludes: + - "**/examples/android/CHIPTest/app/src/main/java/com/tcl/chip/chiptest/MainActivity.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/bluetooth/BluetoothManager.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/ChipClient.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/MultiAdminClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OpCredClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/CHIPLedgerDetailsFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Command.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/MatterCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkLongImSubscribeCommand.kt" + - "**/src/controller/java/src/chip/jsontlv/TlvToJson.kt" + - "**/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadGenerator.kt" + - "**/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt" + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + - "**/src/controller/java/src/chip/onboardingpayload/QRCodeBasicOnboardingPayloadGenerator.kt" + - "**/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt" + UnusedParameter: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/bluetooth/BluetoothManager.kt" + ReturnCount: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/EnterNetworkFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.kt" + - "**/src/controller/java/src/chip/onboardingpayload/Verhoeff.kt" + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + UnusedPrivateProperty: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterInteractionFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/EnterNetworkFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/MatterCommand.kt" + - "**/src/controller/java/src/chip/onboardingpayload/Base38.kt" + ForbiddenComment: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/MultiAdminClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterInteractionFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/AddressCommissioningFragment.kt" + - "**/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadParser.kt" + ExplicitItLambdaParameter: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/HistoryCommandAdapter.kt" + ThrowsCount: + excludes: + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.kt" + - "**/src/controller/java/src/chip/tlv/TlvReader.kt" + - "**/src/controller/java/src/chip/jsontlv/JsonToTlv.kt" + - "**/src/controller/java/src/chip/jsontlv/TlvToJson.kt" + - "**/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadParser.kt" + - "**/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadGenerator.kt" + - "**/src/controller/java/src/chip/onboardingpayload/Base38.kt" + SerialVersionUIDInSerializableClass: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/HistoryCommand.kt" + UnusedPrivateMember: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt" + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + UseCheckOrError: + excludes: + - "**/src/controller/java/src/chip/tlv/tags.kt" + - "**/src/controller/java/src/chip/tlv/types.kt" + UseRequire: + excludes: + - "**/src/controller/java/src/chip/jsontlv/JsonToTlv.kt" + - "**/src/controller/java/src/chip/onboardingpayload/Verhoeff10.kt" + UtilityClassWithPublicConstructor: + excludes: + - "**/src/controller/java/src/chip/onboardingpayload/Verhoeff.kt" + MayBeConst: + excludes: + - "**/src/controller/java/src/chip/onboardingpayload/Base38.kt" + FunctionOnlyReturningConstant: + excludes: + - "**/src/controller/java/src/chip/onboardingpayload/QRCodeOnboardingPayloadGenerator.kt" + +exceptions: + TooGenericExceptionCaught: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Argument.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/Main.kt" + - "**/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt" + SwallowedException: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Argument.kt" + TooGenericExceptionThrown: + excludes: + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/discover/DiscoverCommissionablesCommand.kt" + ThrowingExceptionsWithoutMessageOrCause: + excludes: + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.kt" + +naming: + FunctionNaming: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/SelectActionFragment.kt" + - "**/src/controller/java/tests/chip/tlv/TlvReadWriteTest.kt" + - "**/src/controller/java/tests/chip/tlv/TlvWriterTest.kt" + - "**/src/controller/java/tests/chip/tlv/TlvReaderTest.kt" + - "**/src/controller/java/tests/chip/jsontlv/JsonToTlvToJsonTest.kt" + - "**/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt" + - "**/examples/android/CHIPTest/app/src/test/java/com/tcl/chip/chiptest/ExampleUnitTest.kt" + ConstructorParameterNaming: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/HistoryCommandAdapter.kt" + TopLevelPropertyNaming: + excludes: + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + +performance: + SpreadOperator: + excludes: + - "**/src/controller/java/tests/chip/tlv/TlvReaderTest.kt" + +potential-bugs: + EqualsWithHashCodeExist: + excludes: + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + ImplicitDefaultLocale: + excludes: + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + - "**/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadGenerator.kt" + +complexity: + TooManyFunctions: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/CHIPToolActivity.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/SensorClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/GenericChipDeviceListener.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/SelectActionFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/setuppayloadscanner/BarcodeFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/util/TlvParseUtil.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Command.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairingCommand.kt" + - "**/src/controller/java/src/chip/jsontlv/JsonToTlv.kt" + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + - "**/src/controller/java/src/chip/tlv/TlvReader.kt" + - "**/src/controller/java/src/chip/tlv/TlvWriter.kt" + - "**/src/controller/java/tests/chip/jsontlv/JsonToTlvToJsonTest.kt" + - "**/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt" + - "**/src/controller/java/tests/chip/tlv/TlvReadWriteTest.kt" + NestedBlockDepth: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/WildcardFragment.kt" + LongParameterList: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/clusterinteraction/ClusterDetailFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/Command.kt" + - "**/src/controller/java/src/chip/onboardingpayload/OnboardingPayload.kt" + LongMethod: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/AddressCommissioningFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/common/CommandManager.kt" + - "**/src/controller/java/tests/chip/tlv/TlvReaderTest.kt" + - "**/src/controller/java/tests/chip/jsontlv/JsonToTlvToJsonTest.kt" + - "**/src/controller/java/tests/chip/onboardingpayload/ManualCodeTest.kt" + LargeClass: + excludes: + - "**/src/controller/java/tests/chip/tlv/TlvReadWriteTest.kt" + - "**/src/controller/java/tests/chip/jsontlv/JsonToTlvToJsonTest.kt" + CyclomaticComplexMethod: + excludes: + - "**/src/controller/java/src/chip/tlv/TlvReader.kt" + - "**/src/controller/java/src/chip/tlv/types.kt" + - "**/src/controller/java/src/chip/jsontlv/TlvToJson.kt" + ComplexCondition: + excludes: + - "**/src/controller/java/src/chip/onboardingpayload/ManualOnboardingPayloadGenerator.kt" + +empty-blocks: + EmptyFunctionBlock: + excludes: + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/BasicClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/MultiAdminClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OnOffClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/clusterclient/OpCredClientFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/AddressCommissioningFragment.kt" + - "**/examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/provisioning/DeviceProvisioningFragment.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/discover/DiscoverCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/discover/DiscoverCommissionersCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/CloseSessionCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairCodePaseCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkCommissionerCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkCommissioningModeCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkDeviceTypeCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkFabricCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkInstanceNameCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkShortCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/PairOnNetworkVendorCommand.kt" + - "**/examples/java-matter-controller/java/src/com/matter/controller/commands/pairing/UnpairCommand.kt" diff --git a/src/controller/java/src/chip/tlv/tags.kt b/src/controller/java/src/chip/tlv/tags.kt index 527fd8537e1a43..553030757f5651 100644 --- a/src/controller/java/src/chip/tlv/tags.kt +++ b/src/controller/java/src/chip/tlv/tags.kt @@ -22,7 +22,7 @@ import kotlin.experimental.and import kotlin.experimental.or private const val TAG_MASK = 0b11100000.toByte() -private const val ANONYMOUS = 0b0.toByte() +private const val ANONYMOUS = 0.toByte() private const val CONTEXT_SPECIFIC = 0b00100000.toByte() private const val COMMON_PROFILE_2 = 0b01000000.toByte() private const val COMMON_PROFILE_4 = 0b01100000.toByte()