Strider report
Strider corpus: opentofu
Showing 1000 of 32940 detailed findings. The summary includes all 32940 findings.
cmd/tofu/main_test.go1
55:30add-constant
cmd/tofu/main_test.go:55:30
"both env var and CLI", []string{testCommandName, "foo", "bar"}, "-foo baz",internal/backend/remote-state/consul/backend_state.go1
52:18append-to-sized-slice
internal/backend/remote-state/consul/backend_state.go:52:18
for k := range envs { result = append(result, k) }internal/legacy/helper/schema/schema_test.go1
3136:44argument-overwritten-before-use
internal/legacy/helper/schema/schema_test.go:3136:44
}, CustomizeDiff: func(diff *ResourceDiff, v interface{}) error { v, ok := diff.GetOk("unrelated_set")internal/communicator/ssh/communicator.go1
32:2blank-imports
internal/communicator/ssh/communicator.go:32:2
_ "github.com/opentofu/opentofu/internal/logging")internal/addrs/provider_test.go1
440:7boolean-literal-comparison
internal/addrs/provider_test.go:440:7
if len(diags) > 0 { if test.Err == false { t.Errorf("got error, expected success")internal/backend/local/backend_test.go1
39:3call-to-gc
internal/backend/local/backend_test.go:39:3
if runtime.GOOS == "windows" { runtime.GC() }cmd/tofu/help.go1
19:6cognitive-complexity
cmd/tofu/help.go:19:6
// helpFunc is a cli.HelpFunc that can be used to output the help CLI instructions for OpenTofu.func helpFunc(commands map[string]cli.CommandFactory) string { // Determine the maximum key length, and classify based on typeinternal/addrs/parse_ref.go1
164:6confusing-naming
internal/addrs/parse_ref.go:164:6
func parseRef(traversal hcl.Traversal) (*Reference, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/addrs/move_endpoint_module.go1
452:100confusing-results
internal/addrs/move_endpoint_module.go:452:100
// API.func (e *MoveEndpointInModule) matchModuleInstancePrefix(instAddr ModuleInstance) (ModuleInstance, ModuleInstance, bool) { if len(e.module) > len(instAddr) {internal/command/cliconfig/ociauthconfig/credentials_config.go1
40:6constructor-interface-return
internal/command/cliconfig/ociauthconfig/credentials_config.go:40:6
// helper name.func NewGlobalDockerCredentialHelperCredentialsConfig(locationForUI string, helperName string) CredentialsConfig { return globalDockerCredentialHelperCredentialsConfig{internal/backend/local/backend.go1
355:10context-as-argument
internal/backend/local/backend.go:355:10
doneCh <-chan struct{}, stopCtx context.Context, cancelCtx context.Context,internal/backend/backend.go1
389:2context-stored-in-struct
internal/backend/backend.go:389:2
// is fully done. context.Contextinternal/legacy/helper/schema/resource_data.go1
432:3copy-lock-value
internal/legacy/helper/schema/resource_data.go:432:3
if d.state != nil { copyState = *d.state.DeepCopy() }cmd/tofu/main.go1
53:6cyclomatic-complexity
cmd/tofu/main.go:53:6
func realMain() int { defer logging.PanicHandler()internal/backend/local/local_test.go1
18:2deep-exit
internal/backend/local/local_test.go:18:2
flag.Parse() os.Exit(m.Run())}internal/backend/remote-state/gcs/backend.go1
185:37deprecated-api-usage
internal/backend/remote-state/gcs/backend.go:185:37
// closely as possible. credOptions = append(credOptions, option.WithCredentialsJSON([]byte(contents))) }cmd/tofu/commands.go1
498:13discarded-error-result
cmd/tofu/commands.go:498:13
for key, cmdFact := range commands { cmd, _ := cmdFact() _, ok := cmd.(*command.AliasCommand)cmd/tofu/main_test.go1
253:1doc-comment-period
cmd/tofu/main_test.go:253:1
// verify that we output valid autocomplete resultsfunc TestMain_autoComplete(t *testing.T) {internal/addrs/provider_config.go1
169:2early-return
internal/addrs/provider_config.go:169:2
if tt, ok := remain[1].(hcl.TraverseIndex); ok { if !tt.Key.Type().Equals(cty.String) {internal/command/jsonprovider/attribute.go1
36:2enforce-switch-style
internal/command/jsonprovider/attribute.go:36:2
switch sk { default: return "plain"cmd/tofu/main.go1
369:4error-strings
cmd/tofu/main.go:369:4
return nil, fmt.Errorf( "Error parsing extra CLI args from %s: %s", envName, err)internal/command/cliconfig/credentials.go1
495:6error-type-naming
internal/command/cliconfig/credentials.go:495:6
// in a file that we cannot automatically update.type ErrUnwritableHostCredentials svchost.Hostnameinternal/communicator/ssh/communicator_test.go1
477:2excessive-blank-identifiers
internal/communicator/ssh/communicator_test.go:477:2
func TestHostCert(t *testing.T) { pk, _, _, _, err := ssh.ParseAuthorizedKey([]byte(testServerHostCert)) if err != nil {cmd/tofu/main.go1
46:2exported-declaration-comment
cmd/tofu/main.go:46:2
EnvCPUProfile = "TOFU_CPU_PROFILE")cmd/tofu/commands.go1
1:1file-length-limit
cmd/tofu/commands.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/backend/remote-state/azure/auth/utility.go1
17:65flag-parameter
internal/backend/remote-state/azure/auth/utility.go:17:65
// an error unless acceptEmpty is true.func consolidateFileAndValue(value, fileName, fieldName string, acceptEmpty bool) (string, error) { var fileValue stringcmd/tofu/commands.go2
1:1format
cmd/tofu/commands.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/commands.go`
56:6function-length
cmd/tofu/commands.go:56:6
func initCommands( ctx context.Context,internal/backend/local/backend_local.go1
49:17function-result-limit
internal/backend/local/backend_local.go:49:17
func (b *Local) localRun(ctx context.Context, stopCtx context.Context, op *backend.Operation) (*backend.LocalRun, *configload.Snapshot, statemgr.Full, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/initwd/module_install.go1
324:13identical-branches
internal/initwd/module_install.go:324:13
diags = diags.Extend(mDiags) } else { diags = diags.Extend(mDiags)internal/genconfig/generate_config.go1
110:28identical-if-chain-branches
internal/genconfig/generate_config.go:110:28
writeAttrTypeConstraint(buf, attrS) } else if attrS.Optional { buf.WriteString(strings.Repeat(" ", indent))internal/addrs/check_rule.go1
47:2identical-switch-branches
internal/addrs/check_rule.go:47:2
return fmt.Sprintf("%s.postcondition[%d]", container, c.Index) case OutputPrecondition: return fmt.Sprintf("%s.precondition[%d]", container, c.Index)cmd/tofu/commands.go1
28:2import-alias-naming
cmd/tofu/commands.go:28:2
"github.com/opentofu/opentofu/internal/getproviders" pluginDiscovery "github.com/opentofu/opentofu/internal/plugin/discovery")cmd/tofu/provider_source.go1
240:3import-shadowing
cmd/tofu/provider_source.go:240:3
case cliconfig.ProviderInstallationNetworkMirror: url, err := url.Parse(string(loc)) if err != nil {internal/legacy/hcl2shim/values.go1
160:7impossible-integer-comparison
internal/legacy/hcl2shim/values.go:160:7
const MinInt = -MaxInt - 1 if i <= int64(MaxInt) && i >= int64(MinInt) { return int(i) // Like HCL token.NUMBERinternal/legacy/tofu/state_upgrade_v2_to_v3.go1
145:3increment-decrement
internal/legacy/tofu/state_upgrade_v2_to_v3.go:145:3
output[i] = key i = i + 1 }internal/backend/remote/backend_context.go1
135:8inefficient-map-lookup
internal/backend/remote/backend_context.go:135:8
if _, ok := op.Variables[v.Key]; !ok { op.Variables[v.Key] = &remoteStoredVariableValue{ definition: v,internal/backend/remote-state/pg/client.go1
158:9inefficient-sprintf
internal/backend/remote-state/pg/client.go:158:9
hash.Write([]byte(c.SchemaName + "\x00" + c.TableName)) return fmt.Sprintf("%d", int64(hash.Sum32())*-1)}internal/addrs/module_source_test.go1
267:11insecure-url-scheme
internal/addrs/module_source_test.go:267:11
"HTTP URL": { input: "http://example.com/module", want: ModuleSourceRemote{internal/command/views/backend.go1
14:14interface-method-limit
internal/command/views/backend.go:14:14
type Backend interface { Basicinternal/backend/remote/backend_common.go1
128:7max-control-nesting
internal/backend/remote/backend_common.go:128:7
for _, item := range rl.Items { if !found { if r.ID == item.ID {cmd/tofu/commands.go1
56:6max-parameters
cmd/tofu/commands.go:56:6
func initCommands( ctx context.Context,internal/cloud/tfe_client_mock.go1
525:6max-public-structs
internal/cloud/tfe_client_mock.go:525:6
type MockRedactedPlans struct { client *MockClientinternal/addrs/module.go1
307:2modifies-parameter
internal/addrs/module.go:307:2
kwRange := remain[0].SourceRange() remain = remain[1:] // If we have the prefix "module" then we should be followed by ainternal/addrs/map.go1
47:2modifies-value-receiver
internal/addrs/map.go:47:2
realKey := key.UniqueKey() m.Elems[realKey] = MapElem[K, V]{key, value}}cmd/tofu/commands.go1
54:31nested-structs
cmd/tofu/commands.go:54:31
// hiddenCommands set, because that would be rather silly.var hiddenCommands map[string]struct{}internal/backend/remote-state/azure/client.go2
53:4nil-error-return
internal/backend/remote-state/azure/client.go:53:4
if notFoundError(err) { return nil, nil }53:4nil-value-with-nil-error
internal/backend/remote-state/azure/client.go:53:4
if notFoundError(err) { return nil, nil }internal/builtin/provisioners/remote-exec/resource_provisioner.go1
132:3no-defer-in-loop
internal/builtin/provisioners/remote-exec/resource_provisioner.go:132:3
for _, s := range scripts { defer s.Close() }internal/addrs/parse_target.go1
109:5no-else-after-return
internal/addrs/parse_target.go:109:5
return moduleAddr.ResourceInstance(mode, typeName, name, key), diags } else { diags = diags.Append(&hcl.Diagnostic{internal/backend/remote-state/inmem/backend.go1
32:6no-init
internal/backend/remote-state/inmem/backend.go:32:6
func init() { Reset()internal/addrs/module_source_test.go1
669:2no-naked-return
internal/addrs/module_source_test.go:669:2
} return}cmd/tofu/commands.go1
37:5no-package-var
cmd/tofu/commands.go:37:5
// commands is the mapping of all the available OpenTofu commands.var commands map[string]cli.CommandFactoryinternal/lang/eval/config_dependencies.go1
37:2overwritten-before-use
internal/lang/eval/config_dependencies.go:37:2
// as the initial worker node in the work graph. ctx = grapheval.ContextWithNewWorker(ctx) _ = ctx // just so we can keep the above as a reminder of the need to have a grapheval worker in future workcmd/tofu/commands.go1
6:9package-comments
cmd/tofu/commands.go:6:9
package maininternal/command/jsonformat/structured/attribute_path/matcher.go2
6:9package-directory-mismatch
internal/command/jsonformat/structured/attribute_path/matcher.go:6:9
package attribute_path6:9package-naming
internal/command/jsonformat/structured/attribute_path/matcher.go:6:9
package attribute_pathcmd/tofu/main.go1
443:28range-value-address
cmd/tofu/main.go:443:28
} unmanagedProviders[a] = &plugin.ReattachConfig{ Protocol: plugin.Protocol(c.Protocol),internal/legacy/tofu/resource_address.go1
397:7receiver-naming
internal/legacy/tofu/resource_address.go:397:7
// the new type is required.func (addr *ResourceAddress) AbsResourceInstanceAddr() addrs.AbsResourceInstance { if !addr.HasResourceSpec() {internal/addrs/module_source_resolve.go1
28:3redefines-builtin-id
internal/addrs/module_source_resolve.go:28:3
aRaw := string(a) new := path.Join(aRaw, bRaw) if !isModuleSourceLocal(new) {internal/addrs/instance_key_test.go1
19:4redundant-conversion
internal/addrs/instance_key_test.go:19:4
{ IntKey(0), `[0]`,internal/backend/remote-state/s3/backend_state.go1
18:2redundant-import-alias
internal/backend/remote-state/s3/backend_state.go:18:2
"github.com/aws/aws-sdk-go-v2/service/s3" types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/aws/smithy-go"internal/legacy/helper/schema/field_reader.go1
213:9simplify-range
internal/legacy/helper/schema/field_reader.go:213:9
result := make([]interface{}, countResult.Value.(int)) for i, _ := range result { is := strconv.FormatInt(int64(i), 10)internal/addrs/move_endpoint_module.go1
108:2single-case-switch
internal/addrs/move_endpoint_module.go:108:2
// in the string representation. switch e.relSubject.(type) { case AbsModuleCall, AbsResource:internal/legacy/helper/schema/resource_timeout.go1
144:4single-iteration-loop
internal/legacy/helper/schema/resource_timeout.go:144:4
} return nil }cmd/tofu/provider_source.go1
60:6slice-preallocation
cmd/tofu/provider_source.go:60:6
var diags tfdiags.Diagnostics var searchRules []getproviders.MultiSourceSelectorinternal/backend/remote-state/oss/backend.go1
640:38standard-http-method-constant
internal/backend/remote-state/oss/backend.go:640:38
requestUrl := securityCredURL + ecsRoleName httpRequest, err := http.NewRequest(requests.GET, requestUrl, strings.NewReader("")) if err != nil {cmd/tofu/main.go1
213:2task-comment
cmd/tofu/main.go:213:2
} // TODO meta-refactor - this is temporary because chdir logic strips away the -chdir flag from the args. // Once we move to a different CLI lib, this will be handled by that, where flags defined on a parentinternal/backend/remote-state/s3/validate.go1
253:35time-naming
internal/backend/remote-state/s3/validate.go:253:35
func validateDuration(val string, min, max time.Duration, path cty.Path, diags *tfdiags.Diagnostics) { d, err := time.ParseDuration(val)cmd/tofu/main_test.go1
280:1top-level-declaration-order
cmd/tofu/main_test.go:280:1
type testCommandCLI struct { Args []stringinternal/addrs/check_rule_diagnostic_test.go1
29:30unchecked-type-assertion
internal/addrs/check_rule_diagnostic_test.go:29:30
if overridden[0].ExtraInfo().(*CheckRuleDiagnosticExtra).wrapped.(string) != "extra" { t.Errorf("unexpected extra info: %v", overridden[0].ExtraInfo())internal/backend/remote-state/oss/backend.go1
646:2unclosed-http-response-body
internal/backend/remote-state/oss/backend.go:646:2
httpClient := &http.Client{} httpResponse, err := httpClient.Do(httpRequest) if err != nil {internal/flock/filesystem_lock_windows.go1
30:2unexported-naming
internal/flock/filesystem_lock_windows.go:30:2
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx _LOCKFILE_FAIL_IMMEDIATELY = 1 _LOCKFILE_EXCLUSIVE_LOCK = 2internal/backend/remote-state/s3/backend_complete_test.go1
47:53unexported-return
internal/backend/remote-state/s3/backend_complete_test.go:47:53
func ExpectDiagsEqual(expected tfdiags.Diagnostics) diagsValidator { return func(t *testing.T, diags tfdiags.Diagnostics) {internal/legacy/tofu/state.go1
1293:20unnecessary-format
internal/legacy/tofu/state.go:1293:20
if len(rs.Dependencies) > 0 { buf.WriteString(fmt.Sprintf("\n Dependencies:\n")) for _, dep := range rs.Dependencies {internal/backend/init/testing.go1
148:33unused-parameter
internal/backend/init/testing.go:148:33
// Configure implements Backend.func (m *MockBackend) Configure(ctx context.Context, configObj cty.Value) tfdiags.Diagnostics { m.ConfigureCalled = truecmd/tofu/main_test.go1
289:7unused-receiver
cmd/tofu/main_test.go:289:7
func (c *testCommandCLI) Synopsis() string { return "" }func (c *testCommandCLI) Help() string { return "" }internal/backend/remote-state/consul/backend_test.go1
60:114use-any
internal/backend/remote-state/consul/backend_test.go:60:114
// Get the backend. We need two to test locking. b1 := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/addrs/instance_key.go1
50:17use-errors-new
internal/addrs/instance_key.go:50:17
default: return NoKey, fmt.Errorf("either a string or an integer is required") }internal/encryption/enctest/setup.go1
105:3use-fmt-print
internal/encryption/enctest/setup.go:105:3
for _, d := range diags { println(d.Error()) }internal/addrs/resource_test.go1
677:2use-slices-sort
internal/addrs/resource_test.go:677:2
got := []Resource{managed, data, ephemeral, managed, ephemeral, data} sort.SliceStable(got, func(i, j int) bool { return got[i].Less(got[j]) })internal/cloud/backend_taskStage_taskResults.go1
99:41var-declaration
internal/cloud/backend_taskStage_taskResults.go:99:41
// Track the first task name that is a mandatory enforcement level breach. var firstMandatoryTaskFailed *string = nilinternal/backend/remote-state/azure/auth/msi_auth.go1
63:7var-naming
internal/backend/remote-state/azure/auth/msi_auth.go:63:7
const MSI_ENDPOINT string = "MSI_ENDPOINT"internal/communicator/ssh/communicator_test.go1
103:4waitgroup-add-inside-goroutine
internal/communicator/ssh/communicator_test.go:103:4
for newChannel := range chans { wg.Add(1) channel, requests, err := newChannel.Accept()internal/backend/remote-state/consul/client.go1
116:9weak-cryptography
internal/backend/remote-state/consul/client.go:116:9
md5 := md5.Sum(payload)cmd/tofu/main_test.go1
55:37add-constant
cmd/tofu/main_test.go:55:37
"both env var and CLI", []string{testCommandName, "foo", "bar"}, "-foo baz",internal/legacy/tofu/util.go1
65:19append-to-sized-slice
internal/legacy/tofu/util.go:65:19
if s[i] != result[len(result)-1] { result = append(result, s[i]) }internal/legacy/helper/schema/shims_test.go1
3375:44argument-overwritten-before-use
internal/legacy/helper/schema/shims_test.go:3375:44
}, CustomizeDiff: func(diff *ResourceDiff, v interface{}) error { v, ok := diff.GetOk("unrelated_set")internal/lang/eval/internal/tofu2024/doc.go1
23:2blank-imports
internal/lang/eval/internal/tofu2024/doc.go:23:2
import ( _ "github.com/opentofu/opentofu/internal/configs")internal/backend/remote-state/azure/backend_test.go1
54:5boolean-literal-comparison
internal/backend/remote-state/azure/backend_test.go:54:5
} if b.snapshot != false { t.Fatalf("Incorrect snapshot was populated")internal/backend/local/testing.go1
50:3call-to-gc
internal/backend/local/testing.go:50:3
// on Windows. runtime.GC() })cmd/tofu/main.go1
53:6cognitive-complexity
cmd/tofu/main.go:53:6
func realMain() int { defer logging.PanicHandler()internal/backend/local/backend_local.go1
49:17confusing-naming
internal/backend/local/backend_local.go:49:17
func (b *Local) localRun(ctx context.Context, stopCtx context.Context, op *backend.Operation) (*backend.LocalRun, *configload.Snapshot, statemgr.Full, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/backend/remote-state/oss/backend.go1
456:144confusing-results
internal/backend/remote-state/oss/backend.go:456:144
func getAssumeRoleAK(accessKey, secretKey, stsToken, region, roleArn, sessionName, policy, stsEndpoint string, sessionExpiration int) (string, string, string, error) { request := sts.CreateAssumeRoleRequest()internal/command/cliconfig/ociauthconfig/credentials_source.go1
19:6constructor-interface-return
internal/command/cliconfig/ociauthconfig/credentials_source.go:19:6
func NewStaticCredentialsSource(creds Credentials, spec CredentialsSpecificity) CredentialsSource { return &staticCredentialsSource{internal/backend/local/backend.go1
356:12context-as-argument
internal/backend/local/backend.go:356:12
stopCtx context.Context, cancelCtx context.Context, tfCtx *tofu.Context,internal/builtin/provisioners/file/resource_provisioner.go1
35:2context-stored-in-struct
internal/builtin/provisioners/file/resource_provisioner.go:35:2
// This allows the Stop method to cancel any in-flight requests. ctx context.Context cancel context.CancelFuncinternal/addrs/checkable.go1
96:6cyclomatic-complexity
internal/addrs/checkable.go:96:6
// results between runs.func ParseCheckableStr(kind CheckableKind, src string) (Checkable, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/backend/remote-state/inmem/backend_test.go1
25:2deep-exit
internal/backend/remote-state/inmem/backend_test.go:25:2
flag.Parse() os.Exit(m.Run())}internal/backend/remote-state/gcs/backend_test.go1
465:36deprecated-api-usage
internal/backend/remote-state/gcs/backend_test.go:465:36
// closely as possible. credOptions = append(credOptions, option.WithCredentialsJSON([]byte(contents))) opts = append(opts, credOptions...)cmd/tofu/provider_source_test.go1
182:11discarded-error-result
cmd/tofu/provider_source_test.go:182:11
case "/providers/v1/test/exists/0.0.0/download/foo_os/bar_arch": _, _ = w.Write([]byte(`{"os":"foo_os","arch":"bar_arch","download_url":"/providers/v1/test/exists_0.0.0.zip","shasum":"4cbc33c22abdebe3a3679666d4052ec95c40bd8904a9458f90cf934363a14cc7"}`)) case "/providers/v1/test/exists_0.0.0.zip":internal/addrs/check_rule.go1
84:1doc-comment-period
internal/addrs/check_rule.go:84:1
// describe the type of object being checked rather than the type of the check// itself.)type CheckRuleType intinternal/addrs/provider_config.go1
196:3early-return
internal/addrs/provider_config.go:196:3
if len(remain) > 2 { if tt, ok := remain[2].(hcl.TraverseAttr); ok { ret.Alias = tt.Nameinternal/plugin/convert/schema.go1
141:2enforce-switch-style
internal/plugin/convert/schema.go:141:2
switch k { default: return proto.StringKind_PLAINcmd/tofu/main.go1
421:42error-strings
cmd/tofu/main.go:421:42
if err != nil { return unmanagedProviders, fmt.Errorf("Invalid format for TF_REATTACH_PROVIDERS: %w", err) }internal/command/meta_providers.go1
495:6error-type-naming
internal/command/meta_providers.go:495:6
// to return a more helpful error message.type providerPluginErrors map[addrs.Provider]errorinternal/communicator/ssh/communicator_test.go1
845:3excessive-blank-identifiers
internal/communicator/ssh/communicator_test.go:845:3
return func(_ ssh.ConnMetadata, inkey ssh.PublicKey) (*ssh.Permissions, error) { goodkey, _, _, _, err := ssh.ParseAuthorizedKey([]byte(keystr)) if err != nil {cmd/tofu/version.go1
17:5exported-declaration-comment
cmd/tofu/version.go:17:5
var Version = version.Versioninternal/addrs/module_instance.go1
1:1file-length-limit
internal/addrs/module_instance.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/backend/remote-state/cos/client.go1
331:58flag-parameter
internal/backend/remote-state/cos/client.go:331:58
// deleteBucket delete cos bucketfunc (c *remoteClient) deleteBucket(ctx context.Context, recursive bool) error { if recursive {cmd/tofu/help.go1
1:1format
cmd/tofu/help.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/help.go`
cmd/tofu/main.go1
53:6function-length
cmd/tofu/main.go:53:6
func realMain() int { defer logging.PanicHandler()internal/backend/remote-state/consul/client.go1
686:24function-result-limit
internal/backend/remote-state/consul/client.go:686:24
func (c *RemoteClient) chunkedMode() (bool, string, []string, *consulapi.KVPair, error) { kv := c.Client.KV()internal/addrs/instance_key.go1
140:2identical-switch-branches
internal/addrs/instance_key.go:140:2
return cty.UnknownVal(cty.String).RefineNotNull() default: // (only UnknownKeyType should be left to handle here) // If we don't even know what type of instance key we're expectingcmd/tofu/main.go1
36:2import-alias-naming
cmd/tofu/main.go:36:2
backendInit "github.com/opentofu/opentofu/internal/backend/init")cmd/tofu/provider_source_test.go1
258:4import-shadowing
cmd/tofu/provider_source_test.go:258:4
defer server.Close() disco := disco.New(disco.WithHTTPClient(server.Client())) disco.ForceHostServices("local.testing", map[string]any{internal/legacy/hcl2shim/values.go1
160:29impossible-integer-comparison
internal/legacy/hcl2shim/values.go:160:29
const MinInt = -MaxInt - 1 if i <= int64(MaxInt) && i >= int64(MinInt) { return int(i) // Like HCL token.NUMBERinternal/cloud/backend_context.go1
136:8inefficient-map-lookup
internal/cloud/backend_context.go:136:8
if _, ok := op.Variables[v.Key]; !ok { op.Variables[v.Key] = &remoteStoredVariableValue{ definition: v,internal/builtin/provisioners/local-exec/resource_provisioner_test.go1
327:9inefficient-sprintf
internal/builtin/provisioners/local-exec/resource_provisioner_test.go:327:9
} { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {internal/addrs/module_source_test.go1
269:28insecure-url-scheme
internal/addrs/module_source_test.go:269:28
want: ModuleSourceRemote{ Package: ModulePackage("http://example.com/module"), },internal/command/views/backend_remote.go1
17:20interface-method-limit
internal/command/views/backend_remote.go:17:20
type BackendRemote interface { Basicinternal/backend/remote/backend_common.go1
129:8max-control-nesting
internal/backend/remote/backend_common.go:129:8
if !found { if r.ID == item.ID { found = trueinternal/backend/remote-state/oss/backend.go1
456:6max-parameters
internal/backend/remote-state/oss/backend.go:456:6
func getAssumeRoleAK(accessKey, secretKey, stsToken, region, roleArn, sessionName, policy, stsEndpoint string, sessionExpiration int) (string, string, string, error) { request := sts.CreateAssumeRoleRequest()internal/cloud/tfe_client_mock.go1
571:6max-public-structs
internal/cloud/tfe_client_mock.go:571:6
type MockPlans struct { client *MockClientinternal/addrs/module_source.go1
163:3modifies-parameter
internal/addrs/module_source.go:163:3
// package, not physical filesystem paths. raw = strings.ReplaceAll(raw, `\`, "/") }internal/addrs/set.go1
55:2modifies-value-receiver
internal/addrs/set.go:55:2
func (s Set[T]) Add(addr T) { s[addr.UniqueKey()] = addr}cmd/tofu/commands.go1
465:30nested-structs
cmd/tofu/commands.go:465:30
hiddenCommands = map[string]struct{}{ "env": {},internal/backend/remote-state/cos/client.go1
336:5nil-error-return
internal/backend/remote-state/cos/client.go:336:5
if strings.Contains(err.Error(), "not exists") { return nil }internal/backend/remote-state/azure/client.go1
70:3nil-value-with-nil-error
internal/backend/remote-state/azure/client.go:70:3
if len(data) == 0 { return nil, nil }internal/builtin/provisioners/remote-exec/resource_provisioner.go1
260:3no-defer-in-loop
internal/builtin/provisioners/remote-exec/resource_provisioner.go:260:3
errR, errW := io.Pipe() defer outW.Close() defer errW.Close()internal/addrs/provider_config.go1
445:5no-else-after-return
internal/addrs/provider_config.go:445:5
return fmt.Sprintf("%s.%s.%s", "provider", pc.Provider.LegacyString(), pc.Alias) } else { return fmt.Sprintf("%s.%s.%s.%s", pc.Module.String(), "provider", pc.Provider.LegacyString(), pc.Alias)internal/builtin/providers/tf/provider_test.go1
12:6no-init
internal/builtin/providers/tf/provider_test.go:12:6
func init() { // Initialize the backendsinternal/addrs/module_source_test.go1
679:2no-naked-return
internal/addrs/module_source_test.go:679:2
} return}cmd/tofu/commands.go1
44:5no-package-var
cmd/tofu/commands.go:44:5
// HiddenCommands set appears under "all other commands".var primaryCommands []stringinternal/lang/eval/internal/tofu2024/compile_functions.go1
71:3overwritten-before-use
internal/lang/eval/internal/tofu2024/compile_functions.go:71:3
maybeProvider, err := configgraph.ProviderInstanceFromValue(pv, reqdProvider.Type) maybeProvider, providerMarks := maybeProvider.Unmark() if err != nil {cmd/tofu/experiments.go1
6:9package-comments
cmd/tofu/experiments.go:6:9
package maininternal/command/jsonformat/structured/attribute_path/matcher_test.go2
6:9package-directory-mismatch
internal/command/jsonformat/structured/attribute_path/matcher_test.go:6:9
package attribute_path6:9package-naming
internal/command/jsonformat/structured/attribute_path/matcher_test.go:6:9
package attribute_pathinternal/addrs/move_endpoint_module_test.go1
1338:17range-value-address
internal/addrs/move_endpoint_module_test.go:1338:17
func(t *testing.T) { endpoint := &MoveEndpointInModule{ relSubject: test.Endpoint,internal/legacy/tofu/resource_address.go1
432:7receiver-naming
internal/legacy/tofu/resource_address.go:432:7
// addrs.ModuleInstance value.func (addr *ResourceAddress) ModuleInstanceAddr() addrs.ModuleInstance { path := make(addrs.ModuleInstance, len(addr.Path))internal/addrs/module_source_resolve.go1
61:2redefines-builtin-id
internal/addrs/module_source_resolve.go:61:2
func joinModuleSourceSubPath(subPath, rel string) (string, error) { new := path.Join(subPath, rel) if new == "." {internal/addrs/instance_key_test.go1
23:4redundant-conversion
internal/addrs/instance_key_test.go:23:4
{ IntKey(5), `[5]`,internal/backend/remote-state/s3/backend_test.go1
25:2redundant-import-alias
internal/backend/remote-state/s3/backend_test.go:25:2
"github.com/aws/aws-sdk-go-v2/service/s3" types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/google/go-cmp/cmp"internal/legacy/helper/schema/field_writer_map.go1
153:10simplify-range
internal/legacy/helper/schema/field_writer_map.go:153:10
if err != nil { for i, _ := range vs { is := strconv.FormatInt(int64(i), 10)internal/addrs/move_endpoint_module.go1
358:3single-case-switch
internal/addrs/move_endpoint_module.go:358:3
case AbsModuleCall, ModuleInstance: switch eSub.(type) { case AbsModuleCall, ModuleInstance:cmd/tofu/provider_source.go1
197:6slice-preallocation
cmd/tofu/provider_source.go:197:6
// looked up via the registry source we're about to construct. var directExcluded getproviders.MultiSourceMatchingPatterns for addr := range foundLocally {internal/command/cliconfig/credentials_test.go1
57:31standard-http-method-constant
internal/command/cliconfig/credentials_test.go:57:31
req, err := http.NewRequest("GET", "http://example.com/", nil) if err != nil {cmd/tofu/module_source.go2
17:2task-comment
cmd/tofu/module_source.go:17:2
func remoteModulePackageFetcher(ctx context.Context, getOCICredsPolicy oci.OCICredsPolicyBuilder) *getmodules.PackageFetcher { // TODO: Pass in a real getmodules.PackageFetcherEnvironment here, // which knows how to make use of the OCI authentication policy.24:1top-level-declaration-order
cmd/tofu/module_source.go:24:1
type modulePackageFetcherEnvironment struct { getOCICredsPolicy oci.OCICredsPolicyBuilderinternal/addrs/check_rule_diagnostic_test.go1
29:66unchecked-type-assertion
internal/addrs/check_rule_diagnostic_test.go:29:66
if overridden[0].ExtraInfo().(*CheckRuleDiagnosticExtra).wrapped.(string) != "extra" { t.Errorf("unexpected extra info: %v", overridden[0].ExtraInfo())internal/command/webbrowser/mock.go1
117:3unclosed-http-response-body
internal/command/webbrowser/mock.go:117:3
} resp, err := l.Client.Do(req) if err != nil {internal/flock/filesystem_lock_windows.go1
31:2unexported-naming
internal/flock/filesystem_lock_windows.go:31:2
_LOCKFILE_FAIL_IMMEDIATELY = 1 _LOCKFILE_EXCLUSIVE_LOCK = 2 // https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-internal/backend/remote-state/s3/backend_complete_test.go1
59:86unexported-return
internal/backend/remote-state/s3/backend_complete_test.go:59:86
// ExpectDiagsMatching returns a validator expecting a single Diagnostic with fields matching the expectationfunc ExpectDiagsMatching(severity tfdiags.Severity, summary matcher, detail matcher) diagsValidator { return func(t *testing.T, diags tfdiags.Diagnostics) {internal/backend/local/backend_apply_test.go1
342:63unused-parameter
internal/backend/local/backend_apply_test.go:342:63
func (b *backendWithFailingState) StateMgr(_ context.Context, name string) (statemgr.Full, error) { return &failingState{cmd/tofu/main_test.go1
290:7unused-receiver
cmd/tofu/main_test.go:290:7
func (c *testCommandCLI) Synopsis() string { return "" }func (c *testCommandCLI) Help() string { return "" }internal/backend/remote-state/consul/backend_test.go1
65:114use-any
internal/backend/remote-state/consul/backend_test.go:65:114
b2 := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/backend_local.go1
92:24use-errors-new
internal/backend/local/backend_local.go:92:24
if op.PlanFile.IsCloud() { diags = diags.Append(fmt.Errorf("error: using a saved cloud plan when executing OpenTofu locally is not supported")) return nil, nil, nil, diagsinternal/encryption/example_test.go1
99:3use-fmt-print
internal/encryption/example_test.go:99:3
for _, d := range diags { println(d.Error()) }internal/command/format/diagnostic.go1
320:4use-slices-sort
internal/command/format/diagnostic.go:320:4
copy(values, snippet.Values) sort.Slice(values, func(i, j int) bool { return values[i].Traversal < values[j].Traversalinternal/command/command.go1
15:17var-declaration
internal/command/command.go:15:17
// Set to true when we're testingvar test bool = falseinternal/backend/remote-state/azure/backend_test.go1
122:2var-naming
internal/backend/remote-state/azure/backend_test.go:122:2
func (p mockClient) NewListBlobsFlatPager(params *container.ListBlobsFlatOptions) *runtime.Pager[container.ListBlobsFlatResponse] { env_name := "env-name" blobDetails := make([]*container.BlobItem, 5000)internal/backend/remote-state/consul/client.go1
269:9weak-cryptography
internal/backend/remote-state/consul/client.go:269:9
md5 := md5.Sum(data) chunks := split(payload, 524288)cmd/tofu/main_test.go1
73:13add-constant
cmd/tofu/main_test.go:73:13
"-foo bar", []string{"-foo", "bar", "bar", "", "baz"}, false,internal/registry/client.go1
276:16append-to-sized-slice
internal/registry/client.go:276:16
parts[2] = packageAddr.TargetSystem parts = append(parts, subComponents...) relPath := path.Join(parts...)version/version.go1
13:2blank-imports
version/version.go:13:2
import ( _ "embed" "fmt"internal/cloud/backend_plan_test.go1
399:6boolean-literal-comparison
internal/cloud/backend_plan_test.go:399:6
for _, configVersion := range configVersionsAPI.configVersions { if configVersion.Provisional != true { t.Errorf("wrong Provisional setting in the created configuration version\ngot %v, expected %v", configVersion.Provisional, true)internal/command/apply_test.go1
768:2call-to-gc
internal/command/apply_test.go:768:2
// to avoid TempDir RemoveAll cleanup errors on Windows. runtime.GC()}cmd/tofu/main.go1
405:6cognitive-complexity
cmd/tofu/main.go:405:6
// JSON-encoded environment variable.func parseReattachProviders(in string) (map[addrs.Provider]*plugin.ReattachConfig, error) { unmanagedProviders := map[addrs.Provider]*plugin.ReattachConfig{}internal/backend/remote-state/azure/auth/clients.go1
218:6confusing-naming
internal/backend/remote-state/azure/auth/clients.go:218:6
func newContainerClientFromStorageAccessKey(client *http.Client, names StorageAddresses, storageAccessKey string) (*container.Client, string, error) { sharedKeyCredential, err := container.NewSharedKeyCredential(names.StorageAccount, storageAccessKey)internal/backend/remote-state/oss/backend.go1
456:152confusing-results
internal/backend/remote-state/oss/backend.go:456:152
func getAssumeRoleAK(accessKey, secretKey, stsToken, region, roleArn, sessionName, policy, stsEndpoint string, sessionExpiration int) (string, string, string, error) { request := sts.CreateAssumeRoleRequest()internal/command/cliconfig/ociauthconfig/credentials_source.go1
26:6constructor-interface-return
internal/command/cliconfig/ociauthconfig/credentials_source.go:26:6
func NewDockerCredentialHelperCredentialsSource(helperName string, serverURL string, spec CredentialsSpecificity) CredentialsSource { return &dockerCredentialHelperCredentialSource{internal/backend/local/backend_apply.go1
56:12context-as-argument
internal/backend/local/backend_apply.go:56:12
stopCtx context.Context, cancelCtx context.Context, op *backend.Operation,internal/builtin/provisioners/local-exec/resource_provisioner.go1
45:2context-stored-in-struct
internal/builtin/provisioners/local-exec/resource_provisioner.go:45:2
// This allows the Stop method to cancel any in-flight requests. ctx context.Context cancel context.CancelFuncinternal/addrs/instance_key.go1
219:6cyclomatic-complexity
internal/addrs/instance_key.go:219:6
// - Escaping anything that would be treated as a template interpolation or control sequence.func toHCLQuotedString(s string) string { // This is an adaptation of a similar function inside the hclwrite package,internal/backend/remote/remote_test.go1
29:2deep-exit
internal/backend/remote/remote_test.go:29:2
os.Exit(m.Run())}internal/cloud/tfe_client_mock.go1
501:97deprecated-api-usage
internal/cloud/tfe_client_mock.go:501:97
func (m *MockOrganizations) ReadDataRetentionPolicy(ctx context.Context, organization string) (*tfe.DataRetentionPolicy, error) { panic("not implemented")internal/backend/backend_test.go1
26:2discarded-error-result
internal/backend/backend_test.go:26:2
} f.Close()internal/addrs/for_each_attr.go1
9:1doc-comment-period
internal/addrs/for_each_attr.go:9:1
// ForEachAttr is the address of an attribute referencing the current "for_each" object in// the interpolation scope, addressed using the "each" keyword, ex. "each.key" and "each.value"type ForEachAttr struct {internal/addrs/provider_config.go1
210:3early-return
internal/addrs/provider_config.go:210:3
if len(remain) > 3 { if tt, ok := remain[3].(hcl.TraverseIndex); ok { var keyErr errorinternal/plugin/convert/schema.go1
232:2enforce-switch-style
internal/plugin/convert/schema.go:232:2
switch k { default: return configschema.StringPlaincmd/tofu/main.go1
426:43error-strings
cmd/tofu/main.go:426:43
if diags.HasErrors() { return unmanagedProviders, fmt.Errorf("Error parsing %q as a provider address: %w", a, diags.Err()) }internal/command/show.go1
35:6error-type-naming
internal/command/show.go:35:6
// that! So, we have to do a couple ourselves if we want to preserve that data.type errUnusableDataMisc struct { inner errorinternal/communicator/ssh/provisioner.go1
410:2excessive-blank-identifiers
internal/communicator/ssh/provisioner.go:410:2
// guaranteed to be a certificate. maybeCert, _, _, _, err := ssh.ParseAuthorizedKey([]byte(certificate)) if err != nil {cmd/tofu/version.go1
19:5exported-declaration-comment
cmd/tofu/version.go:19:5
var VersionPrerelease = version.Prereleaseinternal/addrs/module_source_test.go1
1:1file-length-limit
internal/addrs/module_source_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/backend/remote-state/s3/client.go1
617:34flag-parameter
internal/backend/remote-state/s3/client.go:617:34
// More details about the feature: https://docs.aws.amazon.com/sdkref/latest/guide/feature-dataintegrity.htmlfunc s3optDisableDefaultChecksum(skipS3Checksum bool) func(*s3.Options) { if skipS3Checksum {cmd/tofu/main.go1
1:1format
cmd/tofu/main.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/main.go`
cmd/tofu/main_test.go1
19:6function-length
cmd/tofu/main_test.go:19:6
func TestMain_cliArgsFromEnv(t *testing.T) { // Set up the state. This test really messes with the environment andinternal/backend/remote-state/cos/client.go1
188:24function-result-limit
internal/backend/remote-state/cos/client.go:188:24
// getObject get remote objectfunc (c *remoteClient) getObject(ctx context.Context, cosFile string) (exists bool, data []byte, checksum string, err error) { rsp, err := c.cosClient.Object.Get(ctx, cosFile, nil)internal/addrs/instance_key.go1
158:2identical-switch-branches
internal/addrs/instance_key.go:158:2
return true case j == NoKey: return falseinternal/backend/init/init.go1
17:2import-alias-naming
internal/backend/init/init.go:17:2
"github.com/opentofu/opentofu/internal/backend" backendLocal "github.com/opentofu/opentofu/internal/backend/local" backendRemote "github.com/opentofu/opentofu/internal/backend/remote"internal/backend/local/backend.go1
94:2import-shadowing
internal/backend/local/backend.go:94:2
encryption encryption.StateEncryption}internal/command/jsonconfig/expression.go1
154:5inefficient-map-lookup
internal/command/jsonconfig/expression.go:154:5
if _, exists := ret[typeName]; !exists { ret[typeName] = make([]map[string]any, 0, 1) }internal/builtin/provisioners/remote-exec/resource_provisioner_test.go1
317:9inefficient-sprintf
internal/builtin/provisioners/remote-exec/resource_provisioner_test.go:317:9
} { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {internal/backend/remote-state/http/backend_test.go1
27:28insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:27:28
conf := map[string]cty.Value{ "address": cty.StringVal("http://127.0.0.1:8888/foo"), }internal/command/views/init.go1
17:11interface-method-limit
internal/command/views/init.go:17:11
type Init interface { CopyFromModule(src string)internal/backend/remote/backend_common.go1
136:7max-control-nesting
internal/backend/remote/backend_common.go:136:7
// If the run is in a final state, ignore it and continue. switch item.Status { case tfe.RunApplied, tfe.RunCanceled, tfe.RunDiscarded, tfe.RunErrored:internal/lang/eval/internal/tofu2024/compile_resources.go1
26:6max-parameters
internal/lang/eval/internal/tofu2024/compile_resources.go:26:6
func compileModuleInstanceResources( ctx context.Context,internal/cloud/tfe_client_mock.go1
683:6max-public-structs
internal/cloud/tfe_client_mock.go:683:6
type MockTaskStages struct { client *MockClientinternal/addrs/module_source.go1
281:2modifies-parameter
internal/addrs/module_source.go:281:2
var subDir string raw, subDir = getmodules.SplitPackageSubdir(raw) if strings.HasPrefix(subDir, "../") {internal/backend/remote-state/azure/backend_test.go1
137:4modifies-value-receiver
internal/backend/remote-state/azure/backend_test.go:137:4
prevMarker := p.marker p.marker = returnMarker return container.ListBlobsFlatResponse{cmd/tofu/commands.go1
474:30nested-structs
cmd/tofu/commands.go:474:30
// A message will be sent on the channel for every interrupt received.func makeShutdownCh() <-chan struct{} { resultCh := make(chan struct{})internal/backend/remote-state/gcs/client.go1
38:4nil-error-return
internal/backend/remote-state/gcs/client.go:38:4
if errors.Is(err, storage.ErrObjectNotExist) { return nil, nil } else {internal/backend/remote-state/azure/client.go1
357:3nil-value-with-nil-error
internal/backend/remote-state/azure/client.go:357:3
if keyB64 == "" { return nil, nil }internal/builtin/provisioners/remote-exec/resource_provisioner.go1
261:3no-defer-in-loop
internal/builtin/provisioners/remote-exec/resource_provisioner.go:261:3
defer outW.Close() defer errW.Close()internal/addrs/provider_config_test.go1
176:6no-else-after-return
internal/addrs/provider_config_test.go:176:6
return } else { if len(diags) != 0 {internal/command/cliconfig/registry_protocols.go1
192:6no-init
internal/command/cliconfig/registry_protocols.go:192:6
func init() { // BuiltinConfig should contain the default values for a registry_protocolsinternal/backend/local/backend.go1
400:2no-naked-return
internal/backend/local/backend.go:400:2
} return}cmd/tofu/commands.go1
54:5no-package-var
cmd/tofu/commands.go:54:5
// hiddenCommands set, because that would be rather silly.var hiddenCommands map[string]struct{}internal/legacy/tofu/state.go1
442:5overwritten-before-use
internal/legacy/tofu/state.go:442:5
// Found it, remove it is, is[len(is)-1] = append(is[:i], is[i+1:]...), nilcmd/tofu/help.go1
6:9package-comments
cmd/tofu/help.go:6:9
package maininternal/encryption/keyprovider/aws_kms/compliance_test.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/compliance_test.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/compliance_test.go:6:9
package aws_kmsinternal/addrs/move_endpoint_module_test.go1
1343:14range-value-address
internal/addrs/move_endpoint_module_test.go:1343:14
other := &MoveEndpointInModule{ relSubject: test.Other,internal/legacy/tofu/resource_address.go1
446:7receiver-naming
internal/legacy/tofu/resource_address.go:446:7
// an indexed resource instance is contained with the unindexed resource, etc.func (addr *ResourceAddress) Contains(other *ResourceAddress) bool { ourPath := addr.Pathinternal/backend/remote-state/cos/backend.go1
192:29redefines-builtin-id
internal/backend/remote-state/cos/backend.go:192:29
func validateIntegerInRange(min, max int64) schema.SchemaValidateFunc { return func(v interface{}, k string) (ws []string, errors []error) {internal/addrs/instance_key_test.go1
27:4redundant-conversion
internal/addrs/instance_key_test.go:27:4
{ StringKey(""), `[""]`,internal/backend/remote-state/s3/client.go1
27:2redundant-import-alias
internal/backend/remote-state/s3/client.go:27:2
"github.com/aws/aws-sdk-go-v2/service/s3" types "github.com/aws/aws-sdk-go-v2/service/s3/types" multierror "github.com/hashicorp/go-multierror"internal/legacy/helper/schema/field_writer_map.go1
234:11simplify-range
internal/legacy/helper/schema/field_writer_map.go:234:11
if err != nil { for k1, _ := range v { w.set(append(addrCopy, k1), nil)internal/addrs/move_endpoint_module.go2
366:3single-case-switch
internal/addrs/move_endpoint_module.go:366:3
case AbsResource: switch eSub := eSub.(type) { case AbsResource:225:6slice-preallocation
internal/addrs/move_endpoint_module.go:225:6
func (e *MoveEndpointInModule) synthModuleInstance() ModuleInstance { var inst ModuleInstanceinternal/command/cliconfig/credentials_test.go1
230:31standard-http-method-constant
internal/command/cliconfig/credentials_test.go:230:31
req, err := http.NewRequest("GET", "http://example.com/", nil) if err != nil {internal/addrs/module_source_resolve.go1
14:1task-comment
internal/addrs/module_source_resolve.go:14:1
// FIXME: Everything in here should have unit testsinternal/addrs/check.go1
55:1top-level-declaration-order
internal/addrs/check.go:55:1
// a check block within the entire configuration.type ConfigCheck struct { Module Moduleinternal/addrs/instance_key.go1
167:15unchecked-type-assertion
internal/addrs/instance_key.go:167:15
case iTy == IntKeyType: return int(i.(IntKey)) < int(j.(IntKey)) case iTy == StringKeyType:internal/flock/filesystem_lock_windows.go1
135:6unexported-naming
internal/flock/filesystem_lock_windows.go:135:6
func createEvent(sa *syscall.SecurityAttributes, manualReset bool, initialState bool, name *uint16) (handle syscall.Handle, err error) { var _p0 uint32 if manualReset {internal/backend/remote-state/s3/backend_complete_test.go1
81:85unexported-return
internal/backend/remote-state/s3/backend_complete_test.go:81:85
func ExpectDiagMatching(severity tfdiags.Severity, summary matcher, detail matcher) diagValidator { return func(t *testing.T, d tfdiags.Diagnostic) {internal/backend/local/backend_apply_test.go1
354:34unused-parameter
internal/backend/local/backend_apply_test.go:354:34
func (s failingState) WriteState(state *states.State) error { return errors.New("fake failure")internal/addrs/check.go1
49:7unused-receiver
internal/addrs/check.go:49:7
func (c Check) uniqueKeySigil() {}internal/backend/remote-state/consul/backend_test.go1
82:114use-any
internal/backend/remote-state/consul/backend_test.go:82:114
// Get the backend. We need two to test locking. b1 := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/backend_local_test.go1
273:9use-errors-new
internal/backend/local/backend_local_test.go:273:9
func (b backendWithStateStorageThatFailsRefresh) DeleteWorkspace(_ context.Context, name string, force bool) error { return fmt.Errorf("unimplemented")}internal/command/jsonchecks/checks.go1
37:4use-slices-sort
internal/command/jsonchecks/checks.go:37:4
} sort.Slice(problems, func(i, j int) bool { return problems[i].Message < problems[j].Messageinternal/command/login_test.go1
53:46var-declaration
internal/command/login_test.go:53:46
var browserLauncher webbrowser.Launcher = nil if useBrowserLauncher {internal/backend/remote-state/azure/backend_test.go1
318:2var-naming
internal/backend/remote-state/azure/backend_test.go:318:2
client_id := os.Getenv("TF_AZURE_TEST_CLIENT_ID") client_secret := os.Getenv("TF_AZURE_TEST_CLIENT_SECRET")internal/backend/remote-state/cos/backend_test.go1
270:63weak-cryptography
internal/backend/remote-state/cos/backend_test.go:270:63
unique := fmt.Sprintf("%s-%x", t.Name(), time.Now().UnixNano()) return fmt.Sprintf("terraform-test-%s-%s", fmt.Sprintf("%x", md5.Sum([]byte(unique)))[:10], "")}cmd/tofu/main_test.go1
73:39add-constant
cmd/tofu/main_test.go:73:39
"-foo bar", []string{"-foo", "bar", "bar", "", "baz"}, false,internal/cloud/backend_plan_test.go1
403:6boolean-literal-comparison
internal/cloud/backend_plan_test.go:403:6
if configVersion.Speculative != false { t.Errorf("wrong Speculative setting in the created configuration version\ngot %v, expected %v", configVersion.Speculative, false)internal/command/command_test.go1
838:4call-to-gc
internal/command/command_test.go:838:4
if runtime.GOOS == "windows" { runtime.GC() }cmd/tofu/provider_source.go1
52:6cognitive-complexity
cmd/tofu/provider_source.go:52:6
func explicitProviderSource( ctx context.Context,internal/backend/remote-state/consul/client.go1
393:24confusing-naming
internal/backend/remote-state/consul/client.go:393:24
// Only to be called while holding Client.mufunc (c *RemoteClient) lock() (string, error) { // We create a new session here, so it can be canceled when the lock isinternal/backend/remote-state/s3/backend.go1
1090:52confusing-results
internal/backend/remote-state/s3/backend.go:1090:52
func boolAttrOk(obj cty.Value, name string) (bool, bool) { if val := obj.GetAttr(name); val.IsNull() {internal/command/clistate/state.go1
87:6constructor-interface-return
internal/command/clistate/state.go:87:6
// reported to the user through the provided UI.func NewLocker(timeout time.Duration, view views.StateLocker) Locker { return &locker{internal/backend/local/backend_local.go1
34:55context-as-argument
internal/backend/local/backend_local.go:34:55
// backend.Local implementation.func (b *Local) LocalRun(ctx context.Context, stopCtx context.Context, op *backend.Operation) (*backend.LocalRun, statemgr.Full, tfdiags.Diagnostics) { // Make sure the type is invalid. We use this as a way to know notinternal/builtin/provisioners/remote-exec/resource_provisioner.go1
39:2context-stored-in-struct
internal/builtin/provisioners/remote-exec/resource_provisioner.go:39:2
// This allows the Stop method to cancel any in-flight requests. ctx context.Context cancel context.CancelFuncinternal/addrs/map_test.go1
12:6cyclomatic-complexity
internal/addrs/map_test.go:12:6
func TestMap(t *testing.T) { variableName := InputVariable{Name: "name"}internal/builtin/provisioners/remote-exec/resource_provisioner_test.go1
167:3deep-exit
internal/builtin/provisioners/remote-exec/resource_provisioner_test.go:167:3
if err != nil { log.Fatal(err) }internal/cloud/tfe_client_mock.go1
509:102deprecated-api-usage
internal/cloud/tfe_client_mock.go:509:102
func (m *MockOrganizations) SetDataRetentionPolicy(ctx context.Context, organization string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { panic("not implemented")internal/backend/backend_test.go1
48:2discarded-error-result
internal/backend/backend_test.go:48:2
} f.Close()internal/addrs/module_call.go1
155:1doc-comment-period
internal/addrs/module_call.go:155:1
// ModuleCallOutput is the address of a named output and its associated// ModuleCall, which may expand into multiple module instancestype ModuleCallOutput struct {internal/addrs/provider_config.go1
352:2early-return
internal/addrs/provider_config.go:352:2
// We always assume legacy-style providers in legacy state ... if tt, ok := remain[1].(hcl.TraverseAttr); ok { // ... unless it's the builtin "terraform" provider, a special case.internal/plugin6/convert/schema.go1
73:2enforce-switch-style
internal/plugin6/convert/schema.go:73:2
switch k { default: return proto.StringKind_PLAINcmd/tofu/main.go1
433:44error-strings
cmd/tofu/main.go:433:44
if err != nil { return unmanagedProviders, fmt.Errorf("Invalid unix socket path %q for %q: %w", c.Addr.String, p, err) }internal/encryption/keyprovider/errors.go1
11:6error-type-naming
internal/encryption/keyprovider/errors.go:11:6
// ErrKeyProviderFailure indicates a generic key provider failure.type ErrKeyProviderFailure struct { Message stringinternal/communicator/ssh/provisioner.go1
521:3excessive-blank-identifiers
internal/communicator/ssh/provisioner.go:521:3
// finally try it as an authorized key pk, _, _, _, err = ssh.ParseAuthorizedKey(d) if err == nil {internal/addrs/check.go1
14:6exported-declaration-comment
internal/addrs/check.go:14:6
// so this address uniquely describes a single check within a module.type Check struct { referenceableinternal/addrs/move_endpoint_module.go1
1:1file-length-limit
internal/addrs/move_endpoint_module.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/backend/testing.go1
378:57flag-parameter
internal/backend/testing.go:378:57
func testLocksInWorkspace(t *testing.T, b1, b2 Backend, testForceUnlock bool, workspace string) { t.Helper()cmd/tofu/main_test.go2
1:1format
cmd/tofu/main_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/main_test.go`
153:6function-length
cmd/tofu/main_test.go:153:6
// more control over behavior at the expense of more complex test structures.func TestMain_cliArgsFromEnvAdvanced(t *testing.T) { // Restore original CLI argsinternal/backend/remote-state/oss/backend.go1
456:6function-result-limit
internal/backend/remote-state/oss/backend.go:456:6
func getAssumeRoleAK(accessKey, secretKey, stsToken, region, roleArn, sessionName, policy, stsEndpoint string, sessionExpiration int) (string, string, string, error) { request := sts.CreateAssumeRoleRequest()internal/addrs/instance_key.go1
170:2identical-switch-branches
internal/addrs/instance_key.go:170:2
return string(i.(StringKey)) < string(j.(StringKey)) default: // Shouldn't be possible to get down here in practice, since theinternal/backend/init/init.go1
18:2import-alias-naming
internal/backend/init/init.go:18:2
backendLocal "github.com/opentofu/opentofu/internal/backend/local" backendRemote "github.com/opentofu/opentofu/internal/backend/remote" backendAzure "github.com/opentofu/opentofu/internal/backend/remote-state/azure"internal/backend/local/backend.go1
108:21import-shadowing
internal/backend/local/backend.go:108:21
// dedicated backend for non-enhanced behavior.func NewWithBackend(backend backend.Backend, enc encryption.StateEncryption) *Local { return &Local{internal/command/jsonconfig/expression.go1
159:5inefficient-map-lookup
internal/command/jsonconfig/expression.go:159:5
if _, exists := ret[typeName]; !exists { ret[typeName] = make(map[string]map[string]any) }internal/command/jsonformat/state_test.go1
71:9inefficient-sprintf
internal/command/jsonformat/state_test.go:71:9
for i, tt := range tests { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) {internal/backend/remote-state/http/backend_test.go1
35:28insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:35:28
} if client.URL.String() != "http://127.0.0.1:8888/foo" { t.Fatalf("Expected address \"%s\", got \"%s\"", conf["address"], client.URL.String())internal/command/views/login.go1
15:12interface-method-limit
internal/command/views/login.go:15:12
type Login interface { Diagnostics(diags tfdiags.Diagnostics)internal/backend/remote/backend_common.go1
140:8max-control-nesting
internal/backend/remote/backend_common.go:140:8
case tfe.RunPlanned: if op.Type == backend.OperationTypePlan { continueinternal/lang/eval/internal/tofu2024/compile_resources.go1
55:6max-parameters
internal/lang/eval/internal/tofu2024/compile_resources.go:55:6
func compileModuleInstanceResource( ctx context.Context,internal/cloud/tfe_client_mock.go1
713:6max-public-structs
internal/cloud/tfe_client_mock.go:713:6
type MockPolicySetOutcomes struct { client *MockClientinternal/addrs/parse_target.go1
80:3modifies-parameter
internal/addrs/parse_target.go:80:3
mode = DataResourceMode remain = remain[1:] case "ephemeral":internal/backend/remote-state/kubernetes/backend.go1
208:2modifies-value-receiver
internal/backend/remote-state/kubernetes/backend.go:208:2
b.kubernetesSecretClient = client.Resource(secretResource).Namespace(b.namespace) return b.kubernetesSecretClient, nilcmd/tofu/commands.go1
475:24nested-structs
cmd/tofu/commands.go:475:24
func makeShutdownCh() <-chan struct{} { resultCh := make(chan struct{})internal/backend/remote-state/kubernetes/backend.go1
378:4nil-error-return
internal/backend/remote-state/kubernetes/backend.go:378:4
log.Printf("[INFO] Unable to load config file as it doesn't exist at %q", pathErr.Path) return nil, nil }internal/backend/remote-state/consul/client.go1
87:3nil-value-with-nil-error
internal/backend/remote-state/consul/client.go:87:3
if pair == nil { return nil, nil }internal/cloud/state_test.go1
327:4no-defer-in-loop
internal/cloud/state_test.go:327:4
defer server.Close() cfg := &tfe.Config{internal/backend/remote-state/consul/client.go1
262:4no-else-after-return
internal/backend/remote-state/consul/client.go:262:4
return nil } else if !strings.Contains(err.Error(), "too large") { // We failed for some other reason, report this to the userinternal/command/command_test.go1
68:6no-init
internal/command/command_test.go:68:6
func init() { test = trueinternal/backend/local/backend_refresh_test.go1
101:3no-naked-return
internal/backend/local/backend_refresh_test.go:101:3
return }cmd/tofu/experiments.go1
25:5no-package-var
cmd/tofu/experiments.go:25:5
// open experiment.)var experimentsAllowed stringcmd/tofu/main.go1
6:9package-comments
cmd/tofu/main.go:6:9
package maininternal/encryption/keyprovider/aws_kms/config.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/config.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/config.go:6:9
package aws_kmsinternal/addrs/move_endpoint_module_test.go1
1728:13range-value-address
internal/addrs/move_endpoint_module_test.go:1728:13
func(t *testing.T) { from := &MoveEndpointInModule{ relSubject: test.from,internal/legacy/tofu/resource_address.go1
487:7receiver-naming
internal/legacy/tofu/resource_address.go:487:7
// addresses.func (addr *ResourceAddress) Equals(raw interface{}) bool { other, ok := raw.(*ResourceAddress)internal/backend/remote-state/cos/backend.go1
192:34redefines-builtin-id
internal/backend/remote-state/cos/backend.go:192:34
func validateIntegerInRange(min, max int64) schema.SchemaValidateFunc { return func(v interface{}, k string) (ws []string, errors []error) {internal/addrs/instance_key_test.go1
31:4redundant-conversion
internal/addrs/instance_key_test.go:31:4
{ StringKey("hi"), `["hi"]`,internal/cloud/backend_apply_test.go1
20:2redundant-import-alias
internal/cloud/backend_apply_test.go:20:2
tfe "github.com/hashicorp/go-tfe" mocks "github.com/hashicorp/go-tfe/mocks" version "github.com/hashicorp/go-version"internal/legacy/helper/schema/provider.go1
114:9simplify-range
internal/legacy/helper/schema/provider.go:114:9
// Provider-specific checks for k, _ := range sm { if isReservedProviderFieldName(k) {internal/addrs/move_endpoint_module.go1
372:3single-case-switch
internal/addrs/move_endpoint_module.go:372:3
case AbsResourceInstance: switch eSub := eSub.(type) { case AbsResourceInstance:internal/backend/remote-state/consul/client.go1
271:2slice-preallocation
internal/backend/remote-state/consul/client.go:271:2
chunks := split(payload, 524288) chunkPaths := make([]string, 0)internal/command/cliconfig/svcauthconfig/testing.go1
37:34standard-http-method-constant
internal/command/cliconfig/svcauthconfig/testing.go:37:34
fakeReq, err := http.NewRequest("GET", "http://example.com/", nil) if err != nil {internal/backend/init/testing.go1
50:2task-comment
internal/backend/init/testing.go:50:2
func RegisterTemp(name string, f backend.InitFn) func() { // FIXME: It would be better to add a map of backends to command.Meta's existing // "testingOverrides" field, but at the time of writing direct calls to thisinternal/addrs/check_rule.go1
69:1top-level-declaration-order
internal/addrs/check_rule.go:69:1
type checkRuleKey struct { ContainerKey UniqueKeyinternal/addrs/instance_key.go1
167:33unchecked-type-assertion
internal/addrs/instance_key.go:167:33
case iTy == IntKeyType: return int(i.(IntKey)) < int(j.(IntKey)) case iTy == StringKeyType:internal/flock/filesystem_lock_windows.go1
139:6unexported-naming
internal/flock/filesystem_lock_windows.go:139:6
} var _p1 uint32 if initialState {internal/backend/remote-state/s3/backend_complete_test.go1
97:55unexported-return
internal/backend/remote-state/s3/backend_complete_test.go:97:55
func ExpectMultipleDiags(validators ...diagValidator) diagsValidator { return func(t *testing.T, diags tfdiags.Diagnostics) {internal/backend/local/backend_local.go1
563:58unused-parameter
internal/backend/local/backend_local.go:563:58
func (v unparsedUnknownVariableValue) ParseVariableValue(mode configs.VariableParsingMode) (*tofu.InputValue, tfdiags.Diagnostics) { return &tofu.InputValue{internal/addrs/check.go1
66:7unused-receiver
internal/addrs/check.go:66:7
func (c ConfigCheck) configCheckableSigil() {}internal/backend/remote-state/consul/backend_test.go1
88:114use-any
internal/backend/remote-state/consul/backend_test.go:88:114
b2 := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/backend_local_test.go1
288:14use-errors-new
internal/backend/local/backend_local_test.go:288:14
if s.locked { return "", fmt.Errorf("already locked") }internal/command/jsonchecks/checks.go1
48:3use-slices-sort
internal/command/jsonchecks/checks.go:48:3
sort.Slice(objects, func(i, j int) bool { return objects[i].Address["to_display"].(string) < objects[j].Address["to_display"].(string)internal/legacy/helper/schema/resource_test.go1
42:30var-declaration
internal/legacy/helper/schema/resource_test.go:42:30
var s *tofu.InstanceState = nilinternal/backend/remote-state/azure/backend_test.go1
319:2var-naming
internal/backend/remote-state/azure/backend_test.go:319:2
client_id := os.Getenv("TF_AZURE_TEST_CLIENT_ID") client_secret := os.Getenv("TF_AZURE_TEST_CLIENT_SECRET") if client_id == "" || client_secret == "" {internal/backend/remote-state/cos/client.go1
113:29weak-cryptography
internal/backend/remote-state/cos/client.go:113:29
check := fmt.Sprintf("%x", md5.Sum(data)) err = c.putObject(ctx, c.lockFile, data)cmd/tofu/main_test.go1
80:4add-constant
cmd/tofu/main_test.go:80:4
[]string{"", testCommandName, "bar"}, "-foo bar", []string{"-foo", "bar", "bar"},internal/command/views/apply_test.go1
31:5boolean-literal-comparison
internal/command/views/apply_test.go:31:5
if hv.destroy != false { t.Fatalf("unexpected destroy value")internal/command/command_test.go1
922:4call-to-gc
internal/command/command_test.go:922:4
if runtime.GOOS == "windows" { runtime.GC() }cmd/tofu/version.go1
28:6cognitive-complexity
cmd/tofu/version.go:28:6
// we've already performed all of the requested work.func logGodebugUsage() { // These constants reflect the documented conventions from theinternal/backend/remote-state/consul/client.go1
567:24confusing-naming
internal/backend/remote-state/consul/client.go:567:24
// Only to be called while holding Client.mufunc (c *RemoteClient) unlock(id string) error { // This method can be called in two circumstances:internal/command/arguments/extended.go1
224:130confusing-results
internal/command/arguments/extended.go:224:130
func parseRawTargetsAndExcludes(targetsDirect, excludesDirect []string, targetFiles, excludeFiles []string) ([]addrs.Targetable, []addrs.Targetable, tfdiags.Diagnostics) { var allParsedTargets, allParsedExcludes, parsedTargets []addrs.Targetableinternal/command/clistate/state.go1
176:6constructor-interface-return
internal/command/clistate/state.go:176:6
// NewNoopLocker returns a valid Locker that does nothing.func NewNoopLocker() Locker { return noopLocker{}internal/backend/local/backend_local.go1
49:55context-as-argument
internal/backend/local/backend_local.go:49:55
func (b *Local) localRun(ctx context.Context, stopCtx context.Context, op *backend.Operation) (*backend.LocalRun, *configload.Snapshot, statemgr.Full, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/cloud/cloud_integration.go1
31:2context-stored-in-struct
internal/cloud/cloud_integration.go:31:2
B *Cloud StopContext context.Context CancelContext context.Contextinternal/addrs/module_instance.go1
100:6cyclomatic-complexity
internal/addrs/module_instance.go:100:6
// This function supports module addresses with and without instance keys.func parseModuleInstancePrefix(traversal hcl.Traversal) (ModuleInstance, hcl.Traversal, tfdiags.Diagnostics) { remain := traversalinternal/cloud/backend.go1
220:4deep-exit
internal/cloud/backend.go:220:4
if err != nil { log.Panicf("An unexpected error occurred: %s", err) }internal/cloud/tfe_client_mock.go1
509:139deprecated-api-usage
internal/cloud/tfe_client_mock.go:509:139
func (m *MockOrganizations) SetDataRetentionPolicy(ctx context.Context, organization string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { panic("not implemented")internal/backend/backend_test.go1
76:2discarded-error-result
internal/backend/backend_test.go:76:2
} f.Close()internal/addrs/move_endpoint.go1
305:1doc-comment-period
internal/addrs/move_endpoint.go:305:1
// At the time of writing, it was only ensuring that the moved blocks cannot be used against ephemeral resources.// This can later be expanded with more rulesfunc (e *MoveEndpoint) SubjectAllowed() bool {internal/addrs/provider_config.go1
370:3early-return
internal/addrs/provider_config.go:370:3
if len(remain) == 3 { if tt, ok := remain[2].(hcl.TraverseAttr); ok { ret.Alias = tt.Nameinternal/plugin6/convert/schema.go1
242:2enforce-switch-style
internal/plugin6/convert/schema.go:242:2
switch k { default: return configschema.StringPlaincmd/tofu/main.go1
438:44error-strings
cmd/tofu/main.go:438:44
if err != nil { return unmanagedProviders, fmt.Errorf("Invalid TCP address %q for %q: %w", c.Addr.String, p, err) }internal/encryption/keyprovider/errors.go1
28:6error-type-naming
internal/encryption/keyprovider/errors.go:28:6
// ErrInvalidConfiguration indicates that the key provider configuration is incorrect.type ErrInvalidConfiguration struct { Message stringinternal/tofu/context_plan2_test.go1
5549:2excessive-blank-identifiers
internal/tofu/context_plan2_test.go:5549:2
// make sure we can serialize the plan even if there were an error _, _, _, err := contextOptsForPlanViaFile(t, snap, plan) if err != nil {internal/addrs/check.go1
25:16exported-declaration-comment
internal/addrs/check.go:25:16
// address.func (c Check) InModule(modAddr Module) ConfigCheck { return ConfigCheck{internal/addrs/move_endpoint_module_test.go1
1:1file-length-limit
internal/addrs/move_endpoint_module_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/cloud/backend_plan_test.go1
1500:60flag-parameter
internal/cloud/backend_plan_test.go:1500:60
func assertSRORendered(t *testing.T, b *Cloud, r *tfe.Run, shouldRender bool) { got, err := b.shouldRenderStructuredRunOutput(r)cmd/tofu/provider_source.go2
1:1format
cmd/tofu/provider_source.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/provider_source.go`
109:6function-length
cmd/tofu/provider_source.go:109:6
// "exclude" argument in the direct provider source in the CLI config.func implicitProviderSource( ctx context.Context,internal/backend/remote-state/oss/backend.go1
634:6function-result-limit
internal/backend/remote-state/oss/backend.go:634:6
// The related PR: https://github.com/terraform-providers/terraform-provider-alicloud/pull/731func getAuthCredentialByEcsRoleName(ecsRoleName string) (accessKey, secretKey, token string, err error) {internal/addrs/module.go1
108:2identical-switch-branches
internal/addrs/module.go:108:2
case AbsResource: return m.TargetContains(to.Module)internal/backend/init/init.go1
19:2import-alias-naming
internal/backend/init/init.go:19:2
backendRemote "github.com/opentofu/opentofu/internal/backend/remote" backendAzure "github.com/opentofu/opentofu/internal/backend/remote-state/azure" backendConsul "github.com/opentofu/opentofu/internal/backend/remote-state/consul"internal/backend/local/backend_plan_test.go1
657:2import-shadowing
internal/backend/local/backend_plan_test.go:657:2
func getAddrs(resources []*plans.ResourceInstanceChangeSrc) []string { addrs := make([]string, len(resources)) for i, r := range resources {internal/command/jsonstate/state.go1
283:6inefficient-map-lookup
internal/command/jsonstate/state.go:283:6
if _, ok := moduleChildSet[childAddr.Parent().String()]; !ok { moduleChildSet[childAddr.Parent().String()] = map[string]struct{}{} }internal/command/views/hook_ui_test.go1
975:15inefficient-sprintf
internal/command/views/hook_ui_test.go:975:15
for i, tc := range testCases { testName := fmt.Sprintf("%d", i) t.Run(testName, func(t *testing.T) {internal/backend/remote-state/http/backend_test.go1
57:35insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:57:35
conf = map[string]cty.Value{ "address": cty.StringVal("http://127.0.0.1:8888/foo"), "update_method": cty.StringVal("BLAH"),internal/command/views/state.go1
24:12interface-method-limit
internal/command/views/state.go:24:12
type State interface { Diagnostics(diags tfdiags.Diagnostics)internal/backend/remote/backend_common.go1
149:7max-control-nesting
internal/backend/remote/backend_common.go:149:7
// Stop searching when we reached the current run. if w.CurrentRun != nil && w.CurrentRun.ID == item.ID { break runlistinternal/cloud/tfe_client_mock.go1
841:6max-public-structs
internal/cloud/tfe_client_mock.go:841:6
type MockPolicyChecks struct { client *MockClientinternal/addrs/parse_target.go1
83:3modifies-parameter
internal/addrs/parse_target.go:83:3
mode = EphemeralResourceMode remain = remain[1:] }internal/backend/remote-state/kubernetes/backend.go1
222:2modifies-value-receiver
internal/backend/remote-state/kubernetes/backend.go:222:2
b.kubernetesLeaseClient = client.CoordinationV1().Leases(b.namespace) return b.kubernetesLeaseClient, nilcmd/tofu/commands.go1
483:16nested-structs
cmd/tofu/commands.go:483:16
<-signalCh resultCh <- struct{}{} }internal/backend/remote-state/kubernetes/client.go1
58:4nil-error-return
internal/backend/remote-state/kubernetes/client.go:58:4
if k8serrors.IsNotFound(err) { return nil, nil }internal/backend/remote-state/consul/client.go1
352:3nil-value-with-nil-error
internal/backend/remote-state/consul/client.go:352:3
if pair == nil { return nil, nil }internal/command/init_test.go1
3403:4no-defer-in-loop
internal/command/init_test.go:3403:4
// so we don't need to preserve them afterwards. defer close() if err != nil {internal/backend/remote-state/gcs/client.go1
39:5no-else-after-return
internal/backend/remote-state/gcs/client.go:39:5
return nil, nil } else { return nil, fmt.Errorf("Failed to open state file at %v: %w", c.stateFileURL(), err)internal/command/testdata/login-oauth-server/oauthserver.go1
182:6no-init
internal/command/testdata/login-oauth-server/oauthserver.go:182:6
func init() { Handler = handler{}internal/backend/remote-state/azure/auth/msi_auth.go1
69:2no-naked-return
internal/backend/remote-state/azure/auth/msi_auth.go:69:2
os.Unsetenv(MSI_ENDPOINT) return}cmd/tofu/signal_unix.go1
15:5no-package-var
cmd/tofu/signal_unix.go:15:5
var ignoreSignals = []os.Signal{os.Interrupt}var forwardSignals = []os.Signal{syscall.SIGTERM}cmd/tofu/module_source.go1
6:9package-comments
cmd/tofu/module_source.go:6:9
package maininternal/encryption/keyprovider/aws_kms/config_assumerole.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/config_assumerole.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/config_assumerole.go:6:9
package aws_kmsinternal/addrs/move_endpoint_module_test.go1
1732:11range-value-address
internal/addrs/move_endpoint_module_test.go:1732:11
to := &MoveEndpointInModule{ relSubject: test.to,internal/legacy/tofu/resource_address.go1
528:7receiver-naming
internal/legacy/tofu/resource_address.go:528:7
// index 9, rather than after index 1.func (addr *ResourceAddress) Less(other *ResourceAddress) bool {internal/backend/remote-state/oss/backend.go1
74:7redefines-builtin-id
internal/backend/remote-state/oss/backend.go:74:7
ValidateFunc: func(v interface{}, k string) ([]string, []error) { min := 900 max := 3600internal/addrs/instance_key_test.go1
35:4redundant-conversion
internal/addrs/instance_key_test.go:35:4
{ StringKey("0"), `["0"]`, // intentionally distinct from IntKey(0)internal/cloud/backend_apply_test.go1
22:2redundant-import-alias
internal/cloud/backend_apply_test.go:22:2
version "github.com/hashicorp/go-version" gomock "go.uber.org/mock/gomock"internal/legacy/helper/schema/provider.go1
465:9simplify-range
internal/legacy/helper/schema/provider.go:465:9
keys := make([]string, 0, len(p.DataSourcesMap)) for k, _ := range p.DataSourcesMap { keys = append(keys, k)internal/addrs/move_endpoint_module.go1
403:3single-case-switch
internal/addrs/move_endpoint_module.go:403:3
case AbsModuleCall: switch eSub.(type) { case AbsModuleCall:internal/backend/remote-state/consul/client.go1
701:5slice-preallocation
internal/backend/remote-state/consul/client.go:701:5
if ok { chunks := make([]string, 0) for _, c := range d["chunks"].([]interface{}) {internal/command/login.go1
273:31standard-http-method-constant
internal/command/login.go:273:31
req, err := http.NewRequest("GET", motdServiceURL.String(), nil) if err != nil {internal/builtin/providers/tf/resource_data.go1
203:1task-comment
internal/builtin/providers/tf/resource_data.go:203:1
// TODO: This isn't very useful even for examples, because terraform_data has// no way to refresh the full resource value from only the import ID. Thisinternal/addrs/check_rule_diagnostic.go1
42:1top-level-declaration-order
internal/addrs/check_rule_diagnostic.go:42:1
// embedded in the original diagnostic.type CheckRuleDiagnosticExtra struct { CheckRule CheckRuleinternal/addrs/instance_key.go1
169:18unchecked-type-assertion
internal/addrs/instance_key.go:169:18
case iTy == StringKeyType: return string(i.(StringKey)) < string(j.(StringKey)) default:internal/cloud/backend.go1
1100:39unexported-return
internal/cloud/backend.go:1100:39
func (wm WorkspaceMapping) Strategy() workspaceStrategy { switch {internal/backend/local/backend_local_test.go1
256:78unused-parameter
internal/backend/local/backend_local_test.go:256:78
func (b backendWithStateStorageThatFailsRefresh) StateMgr(_ context.Context, workspace string) (statemgr.Full, error) { return &stateStorageThatFailsRefresh{}, nilinternal/addrs/check.go1
68:7unused-receiver
internal/addrs/check.go:68:7
func (c ConfigCheck) CheckableKind() CheckableKind { return CheckableCheckinternal/backend/remote-state/consul/backend_test.go1
104:113use-any
internal/backend/remote-state/consul/backend_test.go:104:113
// Get the backend b := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/backend_local_test.go1
296:10use-errors-new
internal/backend/local/backend_local_test.go:296:10
if !s.locked { return fmt.Errorf("not locked") }internal/command/jsonchecks/checks.go1
59:2use-slices-sort
internal/command/jsonchecks/checks.go:59:2
sort.Slice(jsonResults, func(i, j int) bool { return jsonResults[i].Address["to_display"].(string) < jsonResults[j].Address["to_display"].(string)internal/legacy/helper/schema/resource_test.go1
100:30var-declaration
internal/legacy/helper/schema/resource_test.go:100:30
var s *tofu.InstanceState = nilinternal/backend/remote-state/azure/backend_test.go1
381:2var-naming
internal/backend/remote-state/azure/backend_test.go:381:2
res := testResourceNames(rs, "testState") client_id := os.Getenv("TF_AZURE_TEST_CLIENT_ID") cert_path := os.Getenv("TF_AZURE_TEST_CERT_PATH")internal/backend/remote-state/cos/client.go1
222:29weak-cryptography
internal/backend/remote-state/cos/client.go:222:29
check := fmt.Sprintf("%x", md5.Sum(data)) log.Printf("[DEBUG] getObject %s: check: %s", cosFile, check)cmd/tofu/main_test.go1
185:4add-constant
cmd/tofu/main_test.go:185:4
"targeted to this command", "command", EnvCLI + "_command",internal/command/views/apply_test.go1
35:5boolean-literal-comparison
internal/command/views/apply_test.go:35:5
if hv.view.runningInAutomation != true { // redundant but changed a more relevant check that was here before t.Fatalf("unexpected inAutomation value")internal/command/init_test.go1
133:4call-to-gc
internal/command/init_test.go:133:4
if runtime.GOOS == "windows" { runtime.GC() }internal/addrs/checkable.go1
96:6cognitive-complexity
internal/addrs/checkable.go:96:6
// results between runs.func ParseCheckableStr(kind CheckableKind, src string) (Checkable, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/backend/remote-state/s3/client.go1
119:24confusing-naming
internal/backend/remote-state/s3/client.go:119:24
func (c *RemoteClient) get(ctx context.Context) (*remote.Payload, error) { var output *s3.GetObjectOutputinternal/command/jsonplan/plan.go1
189:41confusing-results
internal/command/jsonplan/plan.go:189:41
schemas *tofu.Schemas,) (map[string]Change, []ResourceChange, []ResourceChange, []ResourceAttr, error) { output := newPlan()internal/command/views/backend.go1
39:6constructor-interface-return
internal/command/views/backend.go:39:6
// that are only reachable from incomplete configured tests.func NewBackendHuman(view *View) Backend { return &BackendHuman{view: view}internal/backend/local/backend_local.go1
150:61context-as-argument
internal/backend/local/backend_local.go:150:61
func (b *Local) localRunDirect(ctx context.Context, stopCtx context.Context, op *backend.Operation, run *backend.LocalRun, coreOpts *tofu.ContextOpts, s statemgr.Full) (*backend.LocalRun, *configload.Snapshot, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/cloud/cloud_integration.go1
32:2context-stored-in-struct
internal/cloud/cloud_integration.go:32:2
StopContext context.Context CancelContext context.Context Op *backend.Operationinternal/addrs/module_instance.go1
430:25cyclomatic-complexity
internal/addrs/module_instance.go:430:25
// is contained within the receiver.func (m ModuleInstance) TargetContains(other Targetable) bool { switch to := other.(type) {internal/cloud/e2e/main_test.go1
37:2deep-exit
internal/cloud/e2e/main_test.go:37:2
os.Exit(code)}internal/cloud/tfe_client_mock.go1
2010:93deprecated-api-usage
internal/cloud/tfe_client_mock.go:2010:93
func (m *MockWorkspaces) ReadDataRetentionPolicy(ctx context.Context, workspaceID string) (*tfe.DataRetentionPolicy, error) { panic("not implemented")internal/backend/backend_test.go1
83:13discarded-error-result
internal/backend/backend_test.go:83:13
} acl, _ := exec.Command("icacls", f.Name()).CombinedOutput() t.Logf("Before /deny %s", acl)internal/addrs/moveable.go1
16:1doc-comment-period
internal/addrs/moveable.go:16:1
// of these in configuration where the author gives an address relative to// the current module where the address is defined. The type MoveEndpointtype AbsMoveable interface {internal/addrs/provider_function.go1
90:9early-return
internal/addrs/provider_function.go:90:9
pf.ProviderName = f.Namespaces[1] } else if len(f.Namespaces) == 3 { // provider::<name>::<alias>::<function>cmd/tofu/main.go1
441:43error-strings
cmd/tofu/main.go:441:43
default: return unmanagedProviders, fmt.Errorf("Unknown address type %q for %q", c.Addr.Network, p) }internal/encryption/keyprovider/errors.go1
52:6error-type-naming
internal/encryption/keyprovider/errors.go:52:6
// ErrInvalidMetadata indicates that the key provider has received an incorrect metadata and cannot decrypt.type ErrInvalidMetadata struct { Message stringinternal/addrs/check.go1
34:16exported-declaration-comment
internal/addrs/check.go:34:16
// address.func (c Check) Absolute(modAddr ModuleInstance) AbsCheck { return AbsCheck{internal/addrs/move_endpoint_test.go1
1:1file-length-limit
internal/addrs/move_endpoint_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/cloud/backend_show.go1
23:80flag-parameter
internal/cloud/backend_show.go:23:80
// show command, in order to format and display a saved cloud plan.func (b *Cloud) ShowPlanForRun(ctx context.Context, runID, runHostname string, redacted bool) (*cloudplan.RemotePlanJSON, error) { var jsonBytes []bytecmd/tofu/provider_source_test.go2
1:1format
cmd/tofu/provider_source_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/provider_source_test.go`
26:6function-length
cmd/tofu/provider_source_test.go:26:6
func TestProviderSource(t *testing.T) { tests := []struct {internal/command/cliconfig/provider_installation.go1
332:6function-result-limit
internal/command/cliconfig/provider_installation.go:332:6
// from inside a provider_installation block.func decodeOCIMirrorInstallationMethodBlock(methodBody *hclast.ObjectType) (location ProviderInstallationLocation, include, exclude []string, diags tfdiags.Diagnostics) { type BodyContent struct {internal/addrs/module.go1
111:2identical-switch-branches
internal/addrs/module.go:111:2
case AbsResourceInstance: return m.TargetContains(to.Module)internal/backend/init/init.go1
20:2import-alias-naming
internal/backend/init/init.go:20:2
backendAzure "github.com/opentofu/opentofu/internal/backend/remote-state/azure" backendConsul "github.com/opentofu/opentofu/internal/backend/remote-state/consul" backendCos "github.com/opentofu/opentofu/internal/backend/remote-state/cos"internal/backend/remote-state/azure/backend.go1
289:2import-shadowing
internal/backend/remote-state/azure/backend.go:289:2
*schema.Backend encryption encryption.StateEncryptioninternal/command/providers_mirror.go1
333:5inefficient-map-lookup
internal/command/providers_mirror.go:333:5
if _, ok := indexArchives[version]; !ok { indexArchives[version] = map[string]interface{}{} }internal/httpclient/useragent_test.go1
37:9inefficient-sprintf
internal/httpclient/useragent_test.go:37:9
} { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { if c.additional != "" {internal/backend/remote-state/http/backend_test.go1
59:35insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:59:35
"update_method": cty.StringVal("BLAH"), "lock_address": cty.StringVal("http://127.0.0.1:8888/bar"), "lock_method": cty.StringVal("BLIP"),internal/command/views/workspace.go1
16:16interface-method-limit
internal/command/views/workspace.go:16:16
type Workspace interface { Diagnostics(diags tfdiags.Diagnostics)internal/backend/remote/backend_common.go1
390:7max-control-nesting
internal/backend/remote/backend_common.go:390:7
if err != nil { if err != io.EOF { return generalError("Failed to read logs", err)internal/cloud/tfe_client_mock.go1
1000:6max-public-structs
internal/cloud/tfe_client_mock.go:1000:6
type MockProjects struct { client *MockClientinternal/addrs/parse_target.go1
91:2modifies-parameter
internal/addrs/parse_target.go:91:2
remain = remain[2:] switch len(remain) {internal/command/flags/raw_flags.go1
57:2modifies-value-receiver
internal/command/flags/raw_flags.go:57:2
func (f RawFlags) Set(str string) error { *f.Items = append(*f.Items, RawFlag{ Name: f.Name,cmd/tofu/main.go1
411:20nested-structs
cmd/tofu/main.go:411:20
ProtocolVersion int Addr struct { Network stringinternal/backend/remote-state/s3/client.go1
146:4nil-error-return
internal/backend/remote-state/s3/client.go:146:4
if errors.As(err, &nk) { return nil, nil }internal/backend/remote-state/cos/client.go1
54:3nil-value-with-nil-error
internal/backend/remote-state/cos/client.go:54:3
if !exists { return nil, nil }internal/command/providers_lock.go1
258:3no-defer-in-loop
internal/command/providers_lock.go:258:3
} defer os.RemoveAll(tempDir)internal/backend/remote-state/kubernetes/client.go1
182:5no-else-after-return
internal/backend/remote-state/kubernetes/client.go:182:5
return "", err } else { return info.ID, nilinternal/command/testdata/login-tfe-server/tfeserver.go1
70:6no-init
internal/command/testdata/login-tfe-server/tfeserver.go:70:6
func init() { Handler = handler{}internal/backend/remote-state/cos/backend.go1
203:3no-naked-return
internal/backend/remote-state/cos/backend.go:203:3
} return }cmd/tofu/signal_unix.go1
16:5no-package-var
cmd/tofu/signal_unix.go:16:5
var ignoreSignals = []os.Signal{os.Interrupt}var forwardSignals = []os.Signal{syscall.SIGTERM}cmd/tofu/plugins.go1
6:9package-comments
cmd/tofu/plugins.go:6:9
package maininternal/encryption/keyprovider/aws_kms/config_endpoints.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/config_endpoints.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/config_endpoints.go:6:9
package aws_kmsinternal/addrs/move_endpoint_test.go1
683:9range-value-address
internal/addrs/move_endpoint_test.go:683:9
t.Run(name, func(t *testing.T) { m := &MoveEndpoint{relSubject: tt.target} if got, want := m.SubjectAllowed(), tt.want; got != want {internal/legacy/tofu/state.go1
848:7receiver-naming
internal/legacy/tofu/state.go:848:7
func (r *RemoteState) init() { r.Lock()internal/backend/remote-state/oss/backend.go1
75:7redefines-builtin-id
internal/backend/remote-state/oss/backend.go:75:7
min := 900 max := 3600 value, ok := v.(int)internal/addrs/instance_key_test.go1
40:4redundant-conversion
internal/addrs/instance_key_test.go:40:4
// Quotes must be escaped StringKey(`"`), `["\""]`,internal/depsfile/locks.go1
12:2redundant-import-alias
internal/depsfile/locks.go:12:2
svchost "github.com/opentofu/svchost"internal/legacy/helper/schema/resource.go1
708:10simplify-range
internal/legacy/helper/schema/resource.go:708:10
tsm = schemaMap(r.Schema) for k, _ := range tsm { if isReservedDataSourceFieldName(k) {internal/addrs/move_endpoint_module.go1
413:3single-case-switch
internal/addrs/move_endpoint_module.go:413:3
case ModuleInstance: switch eSub.(type) { case ModuleInstance, AbsModuleCall:internal/backend/remote-state/consul/client_test.go1
130:3slice-preallocation
internal/backend/remote-state/consul/client_test.go:130:3
} res := make([]string, 0) for _, p := range pairs {internal/command/webbrowser/mock.go1
113:31standard-http-method-constant
internal/command/webbrowser/mock.go:113:31
log.Printf("[DEBUG] webbrowser.MockLauncher: requesting %s", u) req, err := http.NewRequest("GET", u, nil) if err != nil {internal/cloud/backend.go1
743:4task-comment
internal/cloud/backend.go:743:4
} else { // TODO: Ideally we could rely on the client to tell us what the actual // problem was, but we currently can't get enough context from the errorinternal/addrs/checkable.go1
46:1top-level-declaration-order
internal/addrs/checkable.go:46:1
var ( _ Checkable = AbsResourceInstance{}internal/addrs/instance_key.go1
169:42unchecked-type-assertion
internal/addrs/instance_key.go:169:42
case iTy == StringKeyType: return string(i.(StringKey)) < string(j.(StringKey)) default:internal/command/e2etest/encryption_test.go1
28:31unexported-return
internal/command/e2etest/encryption_test.go:28:31
func (r tofuResult) Success() tofuResult { if r.stderr != "" {internal/backend/local/backend_local_test.go1
272:85unused-parameter
internal/backend/local/backend_local_test.go:272:85
func (b backendWithStateStorageThatFailsRefresh) DeleteWorkspace(_ context.Context, name string, force bool) error { return fmt.Errorf("unimplemented")internal/addrs/check.go1
96:7unused-receiver
internal/addrs/check.go:96:7
func (c AbsCheck) checkableSigil() {}internal/backend/remote-state/consul/client.go1
288:41use-any
internal/backend/remote-state/consul/client.go:288:41
// Then we update the link to point to the new chunks payload, err = json.Marshal(map[string]interface{}{ "current-hash": fmt.Sprintf("%x", md5),internal/backend/local/backend_local_test.go1
307:14use-errors-new
internal/backend/local/backend_local_test.go:307:14
func (s *stateStorageThatFailsRefresh) GetRootOutputValues(_ context.Context) (map[string]*states.OutputValue, error) { return nil, fmt.Errorf("unimplemented")}internal/command/jsonconfig/config.go1
601:2use-slices-sort
internal/command/jsonconfig/config.go:601:2
} sort.Slice(rs, func(i, j int) bool { return rs[i].Address < rs[j].Addressinternal/legacy/helper/schema/resource_test.go1
580:30var-declaration
internal/legacy/helper/schema/resource_test.go:580:30
// positive test var s *tofu.InstanceState = nilinternal/backend/remote-state/azure/backend_test.go1
382:2var-naming
internal/backend/remote-state/azure/backend_test.go:382:2
client_id := os.Getenv("TF_AZURE_TEST_CLIENT_ID") cert_path := os.Getenv("TF_AZURE_TEST_CERT_PATH") // cert_password may be emptyinternal/backend/remote-state/cos/client.go1
237:50weak-cryptography
internal/backend/remote-state/cos/client.go:237:50
XCosMetaXXX: &http.Header{ "X-Cos-Meta-Md5": []string{fmt.Sprintf("%x", md5.Sum(data))}, },cmd/tofu/main_test.go1
189:13add-constant
cmd/tofu/main_test.go:189:13
"-flag", []string{"-flag", "foo", "bar"}, false,internal/command/views/apply_test.go1
79:12boolean-literal-comparison
internal/command/views/apply_test.go:79:12
t.Fatalf("unexpected return type %t", v) } else if hv.view.runningInAutomation != true { // redundant but it replaces a previously more relevant check t.Fatalf("unexpected inAutomation value on Operation view")internal/command/meta_backend_test.go1
2143:4call-to-gc
internal/command/meta_backend_test.go:2143:4
if runtime.GOOS == "windows" { runtime.GC() }internal/addrs/instance_key.go1
219:6cognitive-complexity
internal/addrs/instance_key.go:219:6
// - Escaping anything that would be treated as a template interpolation or control sequence.func toHCLQuotedString(s string) string { // This is an adaptation of a similar function inside the hclwrite package,internal/backend/remote/backend.go1
475:18confusing-naming
internal/backend/remote/backend.go:475:18
// workspaces returns a filtered list of remote workspace names.func (b *Remote) workspaces() ([]string, error) { options := &tfe.WorkspaceListOptions{}internal/dag/walk.go1
315:45confusing-results
internal/dag/walk.go:315:45
// The waiter is waiting on the dependency.func (w *Walker) edgeParts(e Edge) (Vertex, Vertex) { if w.Reverse {internal/command/views/backend_remote.go1
54:6constructor-interface-return
internal/command/views/backend_remote.go:54:6
// straightforward.func NewBackendRemote(view *View) BackendRemote { return &BackendRemoteHuman{internal/backend/local/backend_plan.go1
27:12context-as-argument
internal/backend/local/backend_plan.go:27:12
stopCtx context.Context, cancelCtx context.Context, op *backend.Operation,internal/command/clistate/state.go1
73:2context-stored-in-struct
internal/command/clistate/state.go:73:2
type locker struct { ctx context.Context timeout time.Durationinternal/addrs/move_endpoint.go1
174:6cyclomatic-complexity
internal/addrs/move_endpoint.go:174:6
// stating the unification constraints.func UnifyMoveEndpoints(moduleAddr Module, relFrom, relTo *MoveEndpoint) (modFrom, modTo *MoveEndpointInModule) {internal/cloud/e2e/main_test.go1
183:4deep-exit
internal/cloud/e2e/main_test.go:183:4
fmt.Printf("Could not create new tfe client: %v\n", err) os.Exit(1) }internal/cloud/tfe_client_mock.go1
2018:98deprecated-api-usage
internal/cloud/tfe_client_mock.go:2018:98
func (m *MockWorkspaces) SetDataRetentionPolicy(ctx context.Context, workspaceID string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { panic("not implemented")internal/backend/backend_test.go1
91:12discarded-error-result
internal/backend/backend_test.go:91:12
acl, _ = exec.Command("icacls", f.Name()).CombinedOutput() t.Logf("After /deny %s", acl)internal/addrs/provider.go1
17:1doc-comment-period
internal/addrs/provider.go:17:1
// Provider encapsulates a single provider type. In the future this will be// extended to include additional fields including Namespace and SourceHosttype Provider = regaddr.Providerinternal/backend/remote-state/consul/client.go1
190:3early-return
internal/backend/remote-state/consul/client.go:190:3
if c.GZip { if compressedState, err := compressState(data); err == nil { payload = compressedStateinternal/addrs/map_test.go1
71:12error-strings
internal/addrs/map_test.go:71:12
if v, ok := m.GetOk(variableName); v != "Aisling" || !ok { t.Errorf("GetOk for %q returned incorrect result (%q, %#v)", variableName, v, ok) }internal/encryption/method/errors.go1
12:6error-type-naming
internal/encryption/method/errors.go:12:6
// ErrEncryptionFailed, ErrDecryptionFailed, or ErrInvalidConfiguration.type ErrCryptoFailure struct { Message stringinternal/addrs/check.go1
41:16exported-declaration-comment
internal/addrs/check.go:41:16
func (c Check) Equal(o Check) bool { return c.Name == o.Nameinternal/addrs/parse_ref_test.go1
1:1file-length-limit
internal/addrs/parse_ref_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/cloud/backend_show.go1
96:41flag-parameter
internal/cloud/backend_show.go:96:41
func statusFooter(status tfe.RunStatus, isConfirmable, locked bool) string { statusText := strings.ReplaceAll(string(status), "_", " ")cmd/tofu/registries_disco.go1
1:1format
cmd/tofu/registries_disco.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/registries_disco.go`
cmd/tofu/provider_source_test.go1
178:6function-length
cmd/tofu/provider_source_test.go:178:6
// into the child process instead.func TestInitProviderSourceForCLIConfigLocationWithRetries(t *testing.T) { registryHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {internal/command/e2etest/fakeocireg/handler.go1
209:6function-result-limit
internal/command/e2etest/fakeocireg/handler.go:209:6
func parseReqPath(reqPath string) (repoName, noun, arg string, ok bool) { // The OCI distribution protocol uses an interesting path schemeinternal/addrs/module.go1
289:2identical-switch-branches
internal/addrs/module.go:289:2
next = tt.Name case hcl.TraverseAttr: next = tt.Nameinternal/backend/init/init.go1
21:2import-alias-naming
internal/backend/init/init.go:21:2
backendConsul "github.com/opentofu/opentofu/internal/backend/remote-state/consul" backendCos "github.com/opentofu/opentofu/internal/backend/remote-state/cos" backendGCS "github.com/opentofu/opentofu/internal/backend/remote-state/gcs"internal/backend/remote-state/azure/backend_test.go1
96:10import-shadowing
internal/backend/remote-state/azure/backend_test.go:96:10
config["timeout_seconds"] = tc.timeoutSeconds b, _, errors := backend.TestBackendConfigWarningsAndErrors(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(config)) if tc.expectError {internal/command/test.go1
476:5inefficient-map-lookup
internal/command/test.go:476:5
if _, exists := runner.States[key]; !exists { runner.States[key] = &TestFileState{ Run: nil,internal/httpclient/useragent_test.go1
66:9inefficient-sprintf
internal/httpclient/useragent_test.go:66:9
for i, tc := range testCases { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { t.Setenv(appendUaEnvVar, tc.envVarValue)internal/backend/remote-state/http/backend_test.go1
61:35insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:61:35
"lock_method": cty.StringVal("BLIP"), "unlock_address": cty.StringVal("http://127.0.0.1:8888/baz"), "unlock_method": cty.StringVal("BLOOP"),internal/configs/configload/loader.go1
27:13interface-method-limit
internal/configs/configload/loader.go:27:13
// instance directly.type Loader interface { ImportSources(sources map[string][]byte)internal/backend/remote/backend_context.go1
134:7max-control-nesting
internal/backend/remote/backend_context.go:134:7
if v.Category == tfe.CategoryTerraform { if _, ok := op.Variables[v.Key]; !ok { op.Variables[v.Key] = &remoteStoredVariableValue{internal/cloud/tfe_client_mock.go1
1096:6max-public-structs
internal/cloud/tfe_client_mock.go:1096:6
type MockRuns struct { sync.Mutexinternal/addrs/parse_target.go1
146:3modifies-parameter
internal/addrs/parse_target.go:146:3
mode = DataResourceMode remain = remain[1:] case "ephemeral":internal/command/jsonformat/structured/unknown.go1
52:2modifies-value-receiver
internal/command/jsonformat/structured/unknown.go:52:2
// the functions in this package to assume this means it has been deleted. change.AfterExplicit = truecmd/tofu/main_test.go1
38:13nested-structs
cmd/tofu/main_test.go:38:13
cases := []struct { Name stringinternal/backend/remote-state/s3/client.go1
172:4nil-error-return
internal/backend/remote-state/s3/client.go:172:4
if errors.As(err, &nk) { return nil, nil }internal/backend/remote-state/gcs/client.go1
38:4nil-value-with-nil-error
internal/backend/remote-state/gcs/client.go:38:4
if errors.Is(err, storage.ErrObjectNotExist) { return nil, nil } else {internal/backend/remote-state/oss/backend.go1
546:6no-else-after-return
internal/backend/remote-state/oss/backend.go:546:6
return fmt.Errorf("retry timeout and got an error: %w", err) } else { time.Sleep(time.Duration(catcher.RetryWaitSeconds) * time.Second)internal/configs/config_build.go1
345:6no-init
internal/configs/config_build.go:345:6
func init() { DisabledModuleWalker = ModuleWalkerFunc(func(ctx context.Context, req *ModuleRequest) (*Module, *version.Version, hcl.Diagnostics) {internal/backend/remote-state/cos/client.go1
193:3no-naked-return
internal/backend/remote-state/cos/client.go:193:3
err = fmt.Errorf("failed to open file at %v: %w", cosFile, err) return }cmd/tofu/signal_windows.go1
14:5no-package-var
cmd/tofu/signal_windows.go:14:5
var ignoreSignals = []os.Signal{os.Interrupt}var forwardSignals []os.Signalcmd/tofu/provider_source.go1
6:9package-comments
cmd/tofu/provider_source.go:6:9
package maininternal/encryption/keyprovider/aws_kms/config_test.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/config_test.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/config_test.go:6:9
package aws_kmsinternal/backend/local/backend_local.go1
465:42range-value-address
internal/backend/local/backend_local.go:465:42
} rawValue, err := varUiInput.Input(ctx, &tofu.InputOpts{ Id: fmt.Sprintf("var.%s", name),internal/legacy/tofu/state.go1
857:7receiver-naming
internal/legacy/tofu/state.go:857:7
func (r *RemoteState) deepcopy() *RemoteState { r.Lock()internal/backend/remote-state/oss/backend.go1
249:6redefines-builtin-id
internal/backend/remote-state/oss/backend.go:249:6
ValidateFunc: func(v interface{}, k string) ([]string, []error) { min := 900 max := 3600internal/addrs/instance_key_test.go1
45:4redundant-conversion
internal/addrs/instance_key_test.go:45:4
// Escape sequences must themselves be escaped StringKey(`\r\n`), `["\\r\\n"]`,internal/genconfig/generate_config.go1
15:2redundant-import-alias
internal/genconfig/generate_config.go:15:2
"github.com/hashicorp/hcl/v2" hclsyntax "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/hashicorp/hcl/v2/hclwrite"internal/legacy/helper/schema/resource_data.go1
315:9simplify-range
internal/legacy/helper/schema/resource_data.go:315:9
hasDynamicAttributes := false for k, _ := range d.schema { if k == "__has_dynamic_attributes" {internal/addrs/move_endpoint_module.go1
428:3single-case-switch
internal/addrs/move_endpoint_module.go:428:3
// A resource can only contain a resource instance. switch eSub := eSub.(type) { case AbsResourceInstance:internal/backend/remote-state/inmem/backend.go1
102:6slice-preallocation
internal/backend/remote-state/inmem/backend.go:102:6
var workspaces []stringinternal/communicator/ssh/http_proxy.go1
78:30standard-http-method-constant
internal/communicator/ssh/http_proxy.go:78:30
// Create a request object using the CONNECT method to instruct the proxy server to tunnel a protocol other than HTTP. req, err := http.NewRequest("CONNECT", reqUrl.String(), nil) if err != nil {internal/cloud/backend_test.go1
449:61task-comment
internal/cloud/backend_test.go:449:61
}, "with_tags_and_TF_WORKSPACE_env_var_not_matching_tags": { //TODO: once we have proper e2e backend testing we should also add the opposite test - with_tags_and_TF_WORKSPACE_env_var_matching_tags workspaceToCreate: "my-workspace",internal/addrs/input_variable.go1
46:1top-level-declaration-order
internal/addrs/input_variable.go:46:1
// particular module instance.type AbsInputVariableInstance struct { Module ModuleInstanceinternal/addrs/move_endpoint_module.go1
520:33unchecked-type-assertion
internal/addrs/move_endpoint_module.go:520:33
// just slice out the relevant parts. mNewMatch = toMatch.relSubject.(ModuleInstance) mSuffix = mRel[len(relSubject):]internal/command/e2etest/encryption_test.go1
41:31unexported-return
internal/command/e2etest/encryption_test.go:41:31
func (r tofuResult) Failure() tofuResult { if r.err == nil {internal/backend/local/backend_local_test.go1
272:98unused-parameter
internal/backend/local/backend_local_test.go:272:98
func (b backendWithStateStorageThatFailsRefresh) DeleteWorkspace(_ context.Context, name string, force bool) error { return fmt.Errorf("unimplemented")internal/addrs/check.go1
119:7unused-receiver
internal/addrs/check.go:119:7
func (c AbsCheck) CheckableKind() CheckableKind { return CheckableCheckinternal/backend/remote-state/consul/client.go1
693:20use-any
internal/backend/remote-state/consul/client.go:693:20
if pair != nil { var d map[string]interface{} err = json.Unmarshal(pair.Value, &d)internal/backend/local/backend_local_test.go1
311:9use-errors-new
internal/backend/local/backend_local_test.go:311:9
func (s *stateStorageThatFailsRefresh) WriteState(*states.State) error { return fmt.Errorf("unimplemented")}internal/command/jsonentities/diagnostic.go1
445:2use-slices-sort
internal/command/jsonentities/diagnostic.go:445:2
} sort.Slice(values, func(i, j int) bool { return values[i].Traversal < values[j].Traversalinternal/legacy/helper/schema/shims_test.go1
145:30var-declaration
internal/legacy/helper/schema/shims_test.go:145:30
var s *tofu.InstanceState = nilinternal/backend/remote-state/azure/backend_test.go1
384:2var-naming
internal/backend/remote-state/azure/backend_test.go:384:2
// cert_password may be empty cert_password := os.Getenv("TF_AZURE_TEST_CERT_PASSWORD") if client_id == "" || cert_path == "" {internal/backend/remote-state/cos/client.go1
373:36weak-cryptography
internal/backend/remote-state/cos/client.go:373:36
cosPath := fmt.Sprintf("%s:%s", bucket, cosFile) lockTagValue := fmt.Sprintf("%x", md5.Sum([]byte(cosPath)))cmd/tofu/main_test.go1
336:67add-constant
cmd/tofu/main_test.go:336:67
func TestMkConfigDir_noparent(t *testing.T) { tmpConfigDir := filepath.Join(t.TempDir(), "nonexistenthomedir", ".terraform.d")internal/command/views/deprecation_level_test.go1
160:65boolean-literal-comparison
internal/command/views/deprecation_level_test.go:160:65
if tt.lvl != arguments.DeprecationWarningLevelNone { if got := v.DeprecationDiagnosticAllowed(tt.diag[0], seen); got == true { t.Fatalf("expected duplicate diagnostic to be ignored")internal/command/views/test_test.go1
3559:5call-to-gc
internal/command/views/test_test.go:3559:5
if runtime.GOOS == "windows" { runtime.GC() }internal/addrs/map_test.go1
12:6cognitive-complexity
internal/addrs/map_test.go:12:6
func TestMap(t *testing.T) { variableName := InputVariable{Name: "name"}internal/checks/state_report.go1
99:17confusing-naming
internal/checks/state_report.go:99:17
// ReportCheckFailure, and assumes its caller already holds the mutex.func (c *State) reportCheckResult(objectAddr addrs.Checkable, checkType addrs.CheckRuleType, index int, status Status) { configAddr := objectAddr.ConfigCheckable()internal/encryption/keyprovider/azure_vault/compliance_test.go1
17:42confusing-results
internal/encryption/keyprovider/azure_vault/compliance_test.go:17:42
func getKeyAndURI(_ *testing.T) (string, string) { if os.Getenv("TF_ACC") == "" || os.Getenv("TF_AZV_TEST") == "" {internal/command/views/fmt.go1
20:6constructor-interface-return
internal/command/views/fmt.go:20:6
// NewFmt returns an initialized Fmt implementation.func NewFmt(view *View) Fmt { return &FmtHuman{view: view}internal/backend/local/backend_refresh.go1
23:12context-as-argument
internal/backend/local/backend_refresh.go:23:12
stopCtx context.Context, cancelCtx context.Context, op *backend.Operation,internal/command/meta.go1
128:2context-stored-in-struct
internal/command/meta.go:128:2
// will be connected to this parent context if it's present. CallerContext context.Contextinternal/addrs/move_endpoint_module.go1
340:32cyclomatic-complexity
internal/addrs/move_endpoint_module.go:340:32
// is the "from" of another statement.func (e *MoveEndpointInModule) CanChainFrom(other *MoveEndpointInModule) bool { eMod := e.synthModuleInstance()internal/cloud/e2e/main_test.go1
192:3deep-exit
internal/cloud/e2e/main_test.go:192:3
fmt.Printf("Could not change directories: %v\n", err) os.Exit(1) }internal/cloud/tfe_client_mock.go1
2018:135deprecated-api-usage
internal/cloud/tfe_client_mock.go:2018:135
func (m *MockWorkspaces) SetDataRetentionPolicy(ctx context.Context, workspaceID string, options tfe.DataRetentionPolicySetOptions) (*tfe.DataRetentionPolicy, error) { panic("not implemented")internal/backend/backend_test.go1
94:14discarded-error-result
internal/backend/backend_test.go:94:14
defer func() { acl, _ := exec.Command("icacls", f.Name(), "/remove:d", currentUser.Username).CombinedOutput() t.Logf("After remove:d %s", acl)internal/addrs/provider.go1
138:1doc-comment-period
internal/addrs/provider.go:138:1
// - namespace/name// - hostname/namespace/namefunc ParseProviderSourceString(str string) (regaddr.Provider, tfdiags.Diagnostics) {internal/backend/remote-state/kubernetes/backend.go1
360:3early-return
internal/backend/remote-state/kubernetes/backend.go:360:3
exec := &clientcmdapi.ExecConfig{} if spec, ok := v.([]interface{})[0].(map[string]interface{}); ok { exec.APIVersion = spec["api_version"].(string)internal/addrs/map_test.go1
74:12error-strings
internal/addrs/map_test.go:74:12
if v, ok := m.GetOk(eachKey); v != "" || ok { t.Errorf("GetOk for %q returned incorrect result (%q, %#v)", eachKey, v, ok) }internal/encryption/method/errors.go1
34:6error-type-naming
internal/encryption/method/errors.go:34:6
// ErrEncryptionFailed indicates that encrypting a set of data failed.type ErrEncryptionFailed struct { Cause errorinternal/addrs/check.go1
45:16exported-declaration-comment
internal/addrs/check.go:45:16
func (c Check) UniqueKey() UniqueKey { return c // A Check is its own UniqueKeyinternal/addrs/parse_target_test.go1
1:1file-length-limit
internal/addrs/parse_target_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/cloud/backend_show.go1
96:56flag-parameter
internal/cloud/backend_show.go:96:56
func statusFooter(status tfe.RunStatus, isConfirmable, locked bool) string { statusText := strings.ReplaceAll(string(status), "_", " ")cmd/tofu/signal_unix.go1
1:1format
cmd/tofu/signal_unix.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/signal_unix.go`
internal/addrs/checkable.go1
96:6function-length
internal/addrs/checkable.go:96:6
// results between runs.func ParseCheckableStr(kind CheckableKind, src string) (Checkable, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/command/jsonplan/plan.go1
186:6function-result-limit
internal/command/jsonplan/plan.go:186:6
// the part of the plan required by the jsonformat.Plan renderer.func MarshalForRenderer( p *plans.Plan,internal/addrs/module_instance.go1
489:2identical-switch-branches
internal/addrs/module_instance.go:489:2
case AbsResource: return m.TargetContains(to.Module)internal/backend/init/init.go1
22:2import-alias-naming
internal/backend/init/init.go:22:2
backendCos "github.com/opentofu/opentofu/internal/backend/remote-state/cos" backendGCS "github.com/opentofu/opentofu/internal/backend/remote-state/gcs" backendHTTP "github.com/opentofu/opentofu/internal/backend/remote-state/http"internal/backend/remote-state/consul/backend.go1
109:2import-shadowing
internal/backend/remote-state/consul/backend.go:109:2
*schema.Backend encryption encryption.StateEncryptioninternal/configs/config.go1
397:5inefficient-map-lookup
internal/configs/config.go:397:5
// add to this in the loop below. reqs[fqn] = nil }internal/legacy/helper/hashcode/hashcode.go1
46:9inefficient-sprintf
internal/legacy/helper/hashcode/hashcode.go:46:9
return fmt.Sprintf("%d", String(buf.String()))}internal/backend/remote-state/http/backend_test.go1
110:28insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:110:28
conf = map[string]cty.Value{ "address": cty.StringVal("http://127.0.0.1:8888/foo"), "headers": cty.MapVal(map[string]cty.Value{internal/lang/data.go1
30:11interface-method-limit
internal/lang/data.go:30:11
// cty.DynamicVal is returned along with errors describing the problem.type Data interface { StaticValidateReferences(ctx context.Context, refs []*addrs.Reference, self addrs.Referenceable, source addrs.Referenceable) tfdiags.Diagnosticsinternal/cloud/backend_common.go1
126:7max-control-nesting
internal/cloud/backend_common.go:126:7
for _, item := range rl.Items { if !found { if r.ID == item.ID {internal/cloud/tfe_client_mock.go1
1360:6max-public-structs
internal/cloud/tfe_client_mock.go:1360:6
type MockRunEvents struct{}internal/addrs/parse_target.go1
149:3modifies-parameter
internal/addrs/parse_target.go:149:3
mode = EphemeralResourceMode remain = remain[1:] }internal/dag/marshal.go1
92:41modifies-value-receiver
internal/dag/marshal.go:92:41
func (v vertices) Len() int { return len(v) }func (v vertices) Swap(i, j int) { v[i], v[j] = v[j], v[i] }cmd/tofu/main_test.go1
164:13nested-structs
cmd/tofu/main_test.go:164:13
cases := []struct { Name stringinternal/backend/remote/backend.go1
422:3nil-error-return
internal/backend/remote/backend.go:422:3
log.Printf("[WARN] Failed to get credentials for %s: %s (ignoring)", b.hostname, err) return "", nil }internal/backend/remote-state/http/client.go1
193:3nil-value-with-nil-error
internal/backend/remote-state/http/client.go:193:3
case http.StatusNoContent: return nil, nil case http.StatusNotFound:internal/backend/remote-state/oss/client.go1
421:4no-else-after-return
internal/backend/remote-state/oss/client.go:421:4
return nil, fmt.Errorf("estimating object %s is exist got an error: %w", c.stateFile, err) } else if !exist { return nil, nilinternal/depsfile/testing.go1
20:6no-init
internal/depsfile/testing.go:20:6
func init() { // For now, direct comparison of the unexported fields is good enoughinternal/backend/remote-state/cos/client.go1
204:3no-naked-return
internal/backend/remote-state/cos/client.go:204:3
} return }cmd/tofu/signal_windows.go1
15:5no-package-var
cmd/tofu/signal_windows.go:15:5
var ignoreSignals = []os.Signal{os.Interrupt}var forwardSignals []os.Signalcmd/tofu/registries_disco.go1
6:9package-comments
cmd/tofu/registries_disco.go:6:9
package maininternal/encryption/keyprovider/aws_kms/descriptor.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/descriptor.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/descriptor.go:6:9
package aws_kmsinternal/backend/remote-state/consul/client.go1
277:20range-value-address
internal/backend/remote-state/consul/client.go:277:20
chunkPaths = append(chunkPaths, path) _, err := kv.Put(&consulapi.KVPair{ Key: path,internal/legacy/tofu/state.go1
871:7receiver-naming
internal/legacy/tofu/state.go:871:7
func (r *RemoteState) Empty() bool { if r == nil {internal/backend/remote-state/oss/backend.go1
250:6redefines-builtin-id
internal/backend/remote-state/oss/backend.go:250:6
min := 900 max := 3600 value, ok := v.(int)internal/addrs/instance_key_test.go1
50:4redundant-conversion
internal/addrs/instance_key_test.go:50:4
// Template interpolation sequences "${" must be escaped. StringKey(`${hello}`), `["$${hello}"]`,internal/getproviders/registry_client_test.go1
21:2redundant-import-alias
internal/getproviders/registry_client_test.go:21:2
"github.com/opentofu/svchost" disco "github.com/opentofu/svchost/disco")internal/legacy/helper/schema/schema.go1
624:9simplify-range
internal/legacy/helper/schema/schema.go:624:9
keys := make([]string, 0, len(m)) for k, _ := range m { keys = append(keys, k)internal/addrs/move_endpoint_module.go1
725:3single-case-switch
internal/addrs/move_endpoint_module.go:725:3
case AbsModuleCall: switch t := to.relSubject.(type) { case ModuleInstance:internal/backend/remote-state/kubernetes/backend.go1
320:2slice-preallocation
internal/backend/remote-state/kubernetes/backend.go:320:2
expandedPaths := []string{} for _, p := range configPaths {internal/cloud/e2e/helper_test.go1
276:3task-comment
internal/cloud/e2e/helper_test.go:276:3
for { // TODO: update go-tfe Read() to retrieve a tofu version by name. // Currently you can only retrieve by ID.internal/addrs/instance_key.go1
56:1top-level-declaration-order
internal/addrs/instance_key.go:56:1
// of a configuration object that does not use "count" or "for_each" at all.var NoKey InstanceKeyinternal/addrs/move_endpoint_module.go1
543:33unchecked-type-assertion
internal/addrs/move_endpoint_module.go:543:33
// the same key as our call. mNewMatch = toMatch.relSubject.(AbsModuleCall).Instance(callStep.InstanceKey) mSuffix = mRel[len(relSubject.Module)+1:]internal/command/e2etest/encryption_test.go1
60:48unexported-return
internal/command/e2etest/encryption_test.go:60:48
func (r tofuResult) StderrContains(msg string) tofuResult { stdErrSanitized := SanitizeStderr(r.stderr)internal/backend/local/backend_local_test.go1
286:64unused-parameter
internal/backend/local/backend_local_test.go:286:64
func (s *stateStorageThatFailsRefresh) Lock(_ context.Context, info *statemgr.LockInfo) (string, error) { if s.locked {internal/addrs/check.go1
132:7unused-receiver
internal/addrs/check.go:132:7
func (k configCheckUniqueKey) uniqueKeySigil() {}internal/backend/remote-state/consul/client.go1
702:38use-any
internal/backend/remote-state/consul/client.go:702:38
chunks := make([]string, 0) for _, c := range d["chunks"].([]interface{}) { chunks = append(chunks, c.(string))internal/backend/local/backend_local_test.go1
315:9use-errors-new
internal/backend/local/backend_local_test.go:315:9
func (s *stateStorageThatFailsRefresh) MutateState(fn func(*states.State) *states.State) error { return fmt.Errorf("unimplemented")}internal/command/jsonplan/plan.go1
394:2use-slices-sort
internal/command/jsonplan/plan.go:394:2
sortedResources = append(sortedResources, resources...) sort.Slice(sortedResources, func(i, j int) bool { if !sortedResources[i].Addr.Equal(sortedResources[j].Addr) {internal/legacy/helper/schema/shims_test.go1
214:30var-declaration
internal/legacy/helper/schema/shims_test.go:214:30
var s *tofu.InstanceState = nilinternal/backend/remote-state/azure/backend_test.go1
389:2var-naming
internal/backend/remote-state/azure/backend_test.go:389:2
// Make sure we can open and read the file cert_file, err := os.Open(cert_path) if err != nil {internal/backend/remote-state/cos/client.go1
383:36weak-cryptography
internal/backend/remote-state/cos/client.go:383:36
cosPath := fmt.Sprintf("%s:%s", bucket, cosFile) lockTagValue := fmt.Sprintf("%x", md5.Sum([]byte(cosPath)))cmd/tofu/provider_source_test.go1
244:20add-constant
cmd/tofu/provider_source_test.go:244:20
}, expectedErrMsg: "/providers/v1/test/exists_0.0.0.zip giving up after 2 attempt(s)", },internal/command/views/plan_test.go1
30:12boolean-literal-comparison
internal/command/views/plan_test.go:30:12
t.Fatalf("unexpected return type %t", v) } else if hv.view.runningInAutomation != true { // redundant but it replaces a previously more relevant check t.Fatalf("unexpected inAutomation value on Operation view")internal/initwd/from_module_test.go1
316:4call-to-gc
internal/initwd/from_module_test.go:316:4
if runtime.GOOS == "windows" { runtime.GC() }internal/addrs/module.go1
84:17cognitive-complexity
internal/addrs/module.go:84:17
// is contained within the receiver.func (m Module) TargetContains(other Targetable) bool { switch to := other.(type) {internal/cloud/state.go1
386:17confusing-naming
internal/cloud/state.go:386:17
// the s.mu lock.func (s *State) refreshState(ctx context.Context) error { payload, err := s.getStatePayload()internal/getproviders/didyoumean.go1
181:130confusing-results
internal/getproviders/didyoumean.go:181:130
// in a future OpenTofu version.func (s *RegistrySource) lookupLegacyProviderNamespace(ctx context.Context, hostname svchost.Hostname, typeName string) (string, string, error) { client, err := s.registryClient(ctx, hostname)internal/command/views/graph.go1
23:6constructor-interface-return
internal/command/views/graph.go:23:6
// NewGraph returns an initialized Graph implementation for the given ViewType.func NewGraph(view *View) Graph { return &GraphHuman{view: view}internal/backend/remote-state/s3/backend_test.go1
1821:48context-as-argument
internal/backend/remote-state/s3/backend_test.go:1821:48
func numberOfObjectsInBucket(t *testing.T, ctx context.Context, s3Client *s3.Client, bucketName string) int { resp, err := s3Client.ListObjects(ctx, &s3.ListObjectsInput{Bucket: &bucketName})internal/command/test.go1
376:2context-stored-in-struct
internal/command/test.go:376:2
// respond to external calls from the test command. StoppedCtx context.Context CancelledCtx context.Contextinternal/addrs/move_endpoint_module.go1
384:32cyclomatic-complexity
internal/addrs/move_endpoint_module.go:384:32
// select.func (e *MoveEndpointInModule) NestedWithin(other *MoveEndpointInModule) bool { eMod := e.synthModuleInstance()internal/cloud/e2e/main_test.go1
201:3deep-exit
internal/cloud/e2e/main_test.go:201:3
fmt.Printf("Could not create temp directory: %v\n", err) os.Exit(1) }internal/encryption/keyprovider/gcp_kms/config.go1
115:37deprecated-api-usage
internal/encryption/keyprovider/gcp_kms/config.go:115:37
// closely as possible. credOptions = append(credOptions, option.WithCredentialsJSON([]byte(contents))) }internal/backend/backend_test.go1
156:3discarded-error-result
internal/backend/backend_test.go:156:3
t.Cleanup(func() { os.Remove(f.Name()) })internal/addrs/provider.go1
209:1doc-comment-period
internal/addrs/provider.go:209:1
// IsProviderPartNormalized compares a given string to the result of ParseProviderPart(string)func IsProviderPartNormalized(str string) (bool, error) {internal/backend/remote-state/oss/backend.go1
596:2early-return
internal/backend/remote-state/oss/backend.go:596:2
mode := "" if v, ok := providerConfig["mode"]; ok { mode = v.(string)internal/addrs/module_source_test.go1
392:13error-strings
internal/addrs/module_source_test.go:392:13
if remote.Subdir != "foo" { t.Errorf("FromRegistry modified the receiver; should be pure function") }internal/encryption/method/errors.go1
50:6error-type-naming
internal/encryption/method/errors.go:50:6
// ErrDecryptionFailed indicates that decrypting a set of data failed.type ErrDecryptionFailed struct { Cause errorinternal/addrs/check.go1
55:6exported-declaration-comment
internal/addrs/check.go:55:6
// a check block within the entire configuration.type ConfigCheck struct { Module Moduleinternal/addrs/provider_test.go1
1:1file-length-limit
internal/addrs/provider_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/cloud/errors.go1
56:60flag-parameter
internal/cloud/errors.go:56:60
func incompatibleWorkspaceTerraformVersion(message string, ignoreVersionConflict bool) tfdiags.Diagnostic { severity := tfdiags.Errorcmd/tofu/signal_windows.go1
1:1format
cmd/tofu/signal_windows.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/signal_windows.go`
internal/addrs/map_test.go1
12:6function-length
internal/addrs/map_test.go:12:6
func TestMap(t *testing.T) { variableName := InputVariable{Name: "name"}internal/command/show.go1
371:23function-result-limit
internal/command/show.go:371:23
// directory or a statefile.func (c *ShowCommand) getPlanFromPath(ctx context.Context, path string, enc encryption.Encryption, rootCall configs.StaticModuleCall) (*plans.Plan, *cloudplan.RemotePlanJSON, *statefile.File, *configs.Config, error) { var err errorinternal/addrs/module_instance.go1
492:2identical-switch-branches
internal/addrs/module_instance.go:492:2
case AbsResourceInstance: return m.TargetContains(to.Module)internal/backend/init/init.go1
23:2import-alias-naming
internal/backend/init/init.go:23:2
backendGCS "github.com/opentofu/opentofu/internal/backend/remote-state/gcs" backendHTTP "github.com/opentofu/opentofu/internal/backend/remote-state/http" backendInmem "github.com/opentofu/opentofu/internal/backend/remote-state/inmem"internal/backend/remote-state/consul/client.go1
116:2import-shadowing
internal/backend/remote-state/consul/client.go:116:2
md5 := md5.Sum(payload)internal/configs/config.go1
441:4inefficient-map-lookup
internal/configs/config.go:441:4
if _, exists := reqs[fqn]; !exists { reqs[fqn] = nil qualifs.AddImplicitProvider(i.Provider, getproviders.ResourceRef{internal/legacy/helper/schema/resource_test.go1
1670:9inefficient-sprintf
internal/legacy/helper/schema/resource_test.go:1670:9
for i, s := range testStates { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { newState, err := r.Refresh(s, nil)internal/backend/remote-state/http/backend_test.go1
131:21insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:131:21
conf := map[string]string{ "address": "http://127.0.0.1:8888/foo", "update_method": "BLAH",internal/lang/eval/internal/evalglue/module_instance.go1
42:29interface-method-limit
internal/lang/eval/internal/evalglue/module_instance.go:42:29
// successfully.type CompiledModuleInstance interface { // CheckAll collects diagnostics for everything in this module instanceinternal/cloud/backend_common.go1
127:8max-control-nesting
internal/cloud/backend_common.go:127:8
if !found { if r.ID == item.ID { found = trueinternal/cloud/tfe_client_mock.go1
1385:6max-public-structs
internal/cloud/tfe_client_mock.go:1385:6
type MockStateVersions struct { client *MockClientinternal/addrs/parse_target.go1
157:2modifies-parameter
internal/addrs/parse_target.go:157:2
remain = remain[2:] switch len(remain) {internal/dag/marshal.go1
92:47modifies-value-receiver
internal/dag/marshal.go:92:47
func (v vertices) Len() int { return len(v) }func (v vertices) Swap(i, j int) { v[i], v[j] = v[j], v[i] }cmd/tofu/provider_source.go1
138:37nested-structs
cmd/tofu/provider_source.go:138:37
// finally add at the end. foundLocally := map[addrs.Provider]struct{}{}internal/backend/remote/backend_state.go1
44:4nil-error-return
internal/backend/remote/backend_state.go:44:4
// If no state exists, then return nil. return nil, nil }internal/backend/remote-state/http/client.go1
195:3nil-value-with-nil-error
internal/backend/remote-state/http/client.go:195:3
case http.StatusNotFound: return nil, nil case http.StatusUnauthorized:internal/backend/remote-state/pg/backend_test.go1
255:6no-else-after-return
internal/backend/remote-state/pg/backend_test.go:255:6
return } else if diags.HasErrors() { t.Fatal(diags.ErrWithWarnings())internal/encryption/default_registry.go1
23:6no-init
internal/encryption/default_registry.go:23:6
func init() { if err := DefaultRegistry.RegisterKeyProvider(pbkdf2.New()); err != nil {internal/backend/remote-state/cos/client.go1
211:3no-naked-return
internal/backend/remote-state/cos/client.go:211:3
err = fmt.Errorf("failed to open file at %v: checksum %s invalid", cosFile, checksum) return }cmd/tofu/testing.go1
16:5no-package-var
cmd/tofu/testing.go:16:5
// e2e testing features are not available.var e2eTestingFeatures stringcmd/tofu/signal_unix.go1
8:9package-comments
cmd/tofu/signal_unix.go:8:9
package maininternal/encryption/keyprovider/aws_kms/mock_test.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/mock_test.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/mock_test.go:6:9
package aws_kmsinternal/backend/remote-state/cos/backend_test.go1
56:9range-value-address
internal/backend/remote-state/cos/backend_test.go:56:9
t.Run(fmt.Sprintf("%s %s %s", c.prefix, c.key, c.stateName), func(t *testing.T) { b := &Backend{ prefix: c.prefix,internal/legacy/tofu/state.go1
881:7receiver-naming
internal/legacy/tofu/state.go:881:7
func (r *RemoteState) Equals(other *RemoteState) bool { r.Lock()internal/backend/remote-state/s3/validate.go1
253:35redefines-builtin-id
internal/backend/remote-state/s3/validate.go:253:35
func validateDuration(val string, min, max time.Duration, path cty.Path, diags *tfdiags.Diagnostics) { d, err := time.ParseDuration(val)internal/addrs/instance_key_test.go1
55:4redundant-conversion
internal/addrs/instance_key_test.go:55:4
// Template control sequences "%{" must be escaped. StringKey(`%{ for something in something }%{ endfor }`), `["%%{ for something in something }%%{ endfor }"]`,internal/getproviders/registry_source.go1
15:2redundant-import-alias
internal/getproviders/registry_source.go:15:2
"github.com/opentofu/svchost" disco "github.com/opentofu/svchost/disco"internal/legacy/helper/schema/schema.go1
1494:9simplify-range
internal/legacy/helper/schema/schema.go:1494:9
raws := make([]interface{}, rawV.Len()) for i, _ := range raws { raws[i] = rawV.Index(i).Interface()internal/cloud/tfe_client_mock.go1
1301:4single-case-switch
internal/cloud/tfe_client_mock.go:1301:4
for _, n := range options.Include { switch n { case tfe.RunWorkspace:internal/builtin/provisioners/remote-exec/resource_provisioner.go1
159:6slice-preallocation
internal/builtin/provisioners/remote-exec/resource_provisioner.go:159:6
func generateScripts(inline cty.Value) ([]string, error) { var lines []string for _, l := range inline.AsValueSlice() {internal/cloud/tfe_client_mock.go1
704:2task-comment
internal/cloud/tfe_client_mock.go:704:2
func (m *MockTaskStages) Read(ctx context.Context, taskStageID string, options *tfe.TaskStageReadOptions) (*tfe.TaskStage, error) { //TODO implement me panic("implement me")internal/addrs/local_value.go1
38:1top-level-declaration-order
internal/addrs/local_value.go:38:1
// AbsLocalValue is the absolute address of a local value within a module instance.type AbsLocalValue struct { Module ModuleInstanceinternal/addrs/move_endpoint_module.go1
614:37unchecked-type-assertion
internal/addrs/move_endpoint_module.go:614:37
// by the "to" relative address in toMatch. toRelSubject := toMatch.relSubject.(AbsResource) var mNew ModuleInstanceinternal/command/e2etest/encryption_test.go1
69:42unexported-return
internal/command/e2etest/encryption_test.go:69:42
func (r tofuResult) Contains(msg string) tofuResult { if !strings.Contains(r.stdout, msg) {internal/backend/local/backend_local_test.go1
294:66unused-parameter
internal/backend/local/backend_local_test.go:294:66
func (s *stateStorageThatFailsRefresh) Unlock(_ context.Context, id string) error { if !s.locked {internal/addrs/check.go1
136:7unused-receiver
internal/addrs/check.go:136:7
func (k absCheckUniqueKey) uniqueKeySigil() {}internal/backend/remote-state/consul/client_test.go1
44:115use-any
internal/backend/remote-state/consul/client_test.go:44:115
// Get the backend b := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/backend_local_test.go1
319:9use-errors-new
internal/backend/local/backend_local_test.go:319:9
func (s *stateStorageThatFailsRefresh) RefreshState(_ context.Context) error { return fmt.Errorf("intentionally failing for testing purposes")}internal/command/jsonplan/plan.go1
791:2use-slices-sort
internal/command/jsonplan/plan.go:791:2
// deterministic. Our own equivalence tests rely on it. sort.Slice(p.RelevantAttributes, func(i, j int) bool { return p.RelevantAttributes[i].Resource < p.RelevantAttributes[j].Resourceinternal/legacy/tofu/resource.go1
446:29var-declaration
internal/legacy/tofu/resource.go:446:29
var current interface{} = raw var previous interface{} = nil for i, part := range parts {internal/backend/remote-state/azure/client_test.go1
220:2var-naming
internal/backend/remote-state/azure/client_test.go:220:2
client_id := os.Getenv("TF_AZURE_TEST_CLIENT_ID") client_secret := os.Getenv("TF_AZURE_TEST_CLIENT_SECRET")internal/backend/remote-state/http/client.go1
75:11weak-cryptography
internal/backend/remote-state/http/client.go:75:11
// Generate the MD5 hash := md5.Sum(data) b64 := base64.StdEncoding.EncodeToString(hash[:])cmd/tofu/provider_source_test.go1
304:5add-constant
cmd/tofu/provider_source_test.go:304:5
envVars: map[string]string{ "TF_PROVIDER_DOWNLOAD_RETRY": "7", },internal/getproviders/types_test.go1
134:7boolean-literal-comparison
internal/getproviders/types_test.go:134:7
if err != nil { if test.Err == false { t.Errorf("unexpected error: %s", err.Error())internal/addrs/module.go1
226:6cognitive-complexity
internal/addrs/module.go:226:6
// error if it encounters one.func parseModulePrefix(traversal hcl.Traversal) (Module, hcl.Traversal, tfdiags.Diagnostics) { remain := traversalinternal/cloud/tfe_client_mock.go1
416:25confusing-naming
internal/cloud/tfe_client_mock.go:416:25
func (m *mockLogReader) read(l []byte) (int, error) { done, err := m.done()internal/getproviders/didyoumean.go1
196:104confusing-results
internal/getproviders/didyoumean.go:196:104
// depend on it.func (c *registryClient) legacyProviderDefaultNamespace(ctx context.Context, typeName string) (string, string, error) { endpointPath, err := url.Parse(path.Join("-", typeName, "versions"))internal/command/views/json/hook.go1
45:6constructor-interface-return
internal/command/views/json/hook.go:45:6
func NewApplyStart(addr addrs.AbsResourceInstance, action plans.Action, idKey string, idValue string) Hook { hook := &applyStart{internal/backend/remote/backend_apply.go1
24:66context-as-argument
internal/backend/remote/backend_apply.go:24:66
func (b *Remote) opApply(ctx context.Context, stopCtx, cancelCtx context.Context, op *backend.Operation, w *tfe.Workspace) (*tfe.Run, error) { log.Printf("[INFO] backend/remote: starting Apply operation")internal/command/test.go1
377:2context-stored-in-struct
internal/command/test.go:377:2
StoppedCtx context.Context CancelledCtx context.Contextinternal/addrs/move_endpoint_module.go1
477:25cyclomatic-complexity
internal/addrs/move_endpoint_module.go:477:25
// must have matching object types. If not, MoveDestination will panic.func (m ModuleInstance) MoveDestination(fromMatch, toMatch *MoveEndpointInModule) (ModuleInstance, bool) { // NOTE: This implementation assumes the invariant that fromMatch andinternal/cloud/e2e/main_test.go1
208:3deep-exit
internal/cloud/e2e/main_test.go:208:3
fmt.Printf("Could not get current directory: %v\n", err) os.Exit(1) }internal/lang/funcs/crypto.go1
187:15deprecated-api-usage
internal/lang/funcs/crypto.go:187:15
out, err := rsa.DecryptPKCS1v15(nil, privateKey, b) if err != nil {internal/backend/local/backend_test.go1
52:2discarded-error-result
internal/backend/local/backend_test.go:52:2
state, err := statefile.Read(f, encryption.StateEncryptionDisabled()) f.Close() if err != nil {internal/addrs/provider_config.go1
460:1doc-comment-period
internal/addrs/provider_config.go:460:1
// - module.module-name.provider["example.com/namespace/name"]// - module.module-name.provider["example.com/namespace/name"].aliasfunc (pc AbsProviderConfig) String() string {internal/backend/remote-state/oss/backend_state.go1
87:3early-return
internal/backend/remote-state/oss/backend_state.go:87:3
} if resp.IsTruncated { if len(options) == 3 {internal/addrs/module_source_test.go1
395:13error-strings
internal/addrs/module_source_test.go:395:13
if registry.Subdir != "bar" { t.Errorf("FromRegistry modified the given address; should be pure function") }internal/encryption/method/errors.go1
66:6error-type-naming
internal/encryption/method/errors.go:66:6
// ErrDecryptionKeyUnavailable indicates that no decryption key is available.type ErrDecryptionKeyUnavailable struct {}internal/addrs/check.go1
62:22exported-declaration-comment
internal/addrs/check.go:62:22
func (c ConfigCheck) UniqueKey() UniqueKey { return configCheckUniqueKey(c.String())internal/addrs/resource.go1
1:1file-length-limit
internal/addrs/resource.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/cloud/state.go1
115:59flag-parameter
internal/cloud/state.go:115:59
// WriteStateForMigration is part of our implementation of statemgr.Migrator.func (s *State) WriteStateForMigration(f *statefile.File, force bool) error { s.mu.Lock()cmd/tofu/webbrowser.go1
1:1format
cmd/tofu/webbrowser.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/webbrowser.go`
internal/addrs/module_source_test.go1
16:6function-length
internal/addrs/module_source_test.go:16:6
func TestParseModuleSource(t *testing.T) {internal/command/show.go1
435:6function-result-limit
internal/command/show.go:435:6
// getDataFromPlanfileReader returns a plan, statefile, and config, extracted from a local plan file.func getDataFromPlanfileReader(ctx context.Context, planReader *planfile.Reader, rootCall configs.StaticModuleCall) (*plans.Plan, *statefile.File, *configs.Config, error) { // Get planinternal/addrs/move_endpoint_module.go1
173:2identical-switch-branches
internal/addrs/move_endpoint_module.go:173:2
return relSubject.Resource.Absolute(retModAddr) case AbsResource: retModAddr := make(ModuleInstance, 0, len(modInst)+len(relSubject.Module))internal/backend/init/init.go1
24:2import-alias-naming
internal/backend/init/init.go:24:2
backendHTTP "github.com/opentofu/opentofu/internal/backend/remote-state/http" backendInmem "github.com/opentofu/opentofu/internal/backend/remote-state/inmem" backendKubernetes "github.com/opentofu/opentofu/internal/backend/remote-state/kubernetes"internal/backend/remote-state/consul/client.go1
269:2import-shadowing
internal/backend/remote-state/consul/client.go:269:2
md5 := md5.Sum(data) chunks := split(payload, 524288)internal/configs/config.go1
573:3inefficient-map-lookup
internal/configs/config.go:573:3
// add to this in the loop below. reqs[fqn] = nil }internal/legacy/tofu/diff_test.go1
1201:9inefficient-sprintf
internal/legacy/tofu/diff_test.go:1201:9
for i, tc := range cases { t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { same, reason := tc.One.Same(tc.Two)internal/backend/remote-state/http/backend_test.go1
133:21insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:133:21
"update_method": "BLAH", "lock_address": "http://127.0.0.1:8888/bar", "lock_method": "BLIP",internal/legacy/tofu/resource_provider.go1
13:23interface-method-limit
internal/legacy/tofu/resource_provider.go:13:23
// named "providers".type ResourceProvider interface { /*********************************************************************internal/cloud/backend_common.go1
134:7max-control-nesting
internal/cloud/backend_common.go:134:7
// If the run is in a final state, ignore it and continue. switch item.Status { case tfe.RunApplied, tfe.RunCanceled, tfe.RunDiscarded, tfe.RunErrored:internal/cloud/tfe_client_mock.go1
1520:6max-public-structs
internal/cloud/tfe_client_mock.go:1520:6
type MockStateVersionOutputs struct { client *MockClientinternal/backend/backend.go1
364:3modifies-parameter
internal/backend/backend.go:364:3
if diags.HasErrors() { op.Result = OperationFailure } else {internal/dag/marshal.go1
119:38modifies-value-receiver
internal/dag/marshal.go:119:38
func (e edges) Len() int { return len(e) }func (e edges) Swap(i, j int) { e[i], e[j] = e[j], e[i] }cmd/tofu/provider_source.go1
158:28nested-structs
cmd/tofu/provider_source.go:158:28
for found := range available { foundLocally[found] = struct{}{} }internal/cloud/backend.go1
519:3nil-error-return
internal/cloud/backend.go:519:3
log.Printf("[WARN] Failed to get credentials for %s: %s (ignoring)", b.hostname, err) return "", nil }internal/backend/remote-state/http/client.go1
223:3nil-value-with-nil-error
internal/backend/remote-state/http/client.go:223:3
if len(payload.Data) == 0 { return nil, nil }internal/backend/remote-state/pg/backend_test.go1
284:6no-else-after-return
internal/backend/remote-state/pg/backend_test.go:284:6
return } else if len(confDiags) != 0 { confDiags = confDiags.InConfigBody(config, "")internal/experiments/experiment.go1
28:6no-init
internal/experiments/experiment.go:28:6
func init() { // Each experiment constant defined above must be registered here as eitherinternal/backend/remote-state/cos/client.go1
219:3no-naked-return
internal/backend/remote-state/cos/client.go:219:3
err = fmt.Errorf("failed to open file at %v: %w", cosFile, err) return }cmd/tofu/version.go1
17:5no-package-var
cmd/tofu/version.go:17:5
var Version = version.Versioncmd/tofu/signal_windows.go1
8:9package-comments
cmd/tofu/signal_windows.go:8:9
package maininternal/encryption/keyprovider/aws_kms/provider.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/provider.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/provider.go:6:9
package aws_kmsinternal/backend/remote-state/gcs/backend_test.go1
81:8range-value-address
internal/backend/remote-state/gcs/backend_test.go:81:8
for _, c := range cases { b := &Backend{ prefix: c.prefix,internal/legacy/tofu/state.go1
1006:7receiver-naming
internal/legacy/tofu/state.go:1006:7
// Equal tests whether one module state is equal to another.func (m *ModuleState) Equal(other *ModuleState) bool { m.Lock()internal/backend/remote-state/s3/validate.go1
253:40redefines-builtin-id
internal/backend/remote-state/s3/validate.go:253:40
func validateDuration(val string, min, max time.Duration, path cty.Path, diags *tfdiags.Diagnostics) { d, err := time.ParseDuration(val)internal/addrs/instance_key_test.go1
60:4redundant-conversion
internal/addrs/instance_key_test.go:60:4
// Dollar signs that aren't followed by { are not interpolation sequences StringKey(`$hello`), `["$hello"]`,internal/legacy/helper/schema/schema.go1
1580:9simplify-range
internal/legacy/helper/schema/schema.go:1580:9
raws := make([]interface{}, rawV.Len()) for i, _ := range raws { raws[i] = rawV.Index(i).Interface()internal/configs/configschema/path.go1
18:3single-case-switch
internal/configs/configschema/path.go:18:3
for i, step := range path { switch step := step.(type) { case cty.GetAttrStep:internal/builtin/provisioners/remote-exec/resource_provisioner.go1
186:7slice-preallocation
internal/builtin/provisioners/remote-exec/resource_provisioner.go:186:7
var r []io.ReadCloser for _, script := range scripts {internal/cloud/tfe_client_mock.go1
709:2task-comment
internal/cloud/tfe_client_mock.go:709:2
func (m *MockTaskStages) List(ctx context.Context, runID string, options *tfe.TaskStageListOptions) (*tfe.TaskStageList, error) { //TODO implement me panic("implement me")internal/addrs/module.go1
34:1top-level-declaration-order
internal/addrs/module.go:34:1
// represented by RootModuleInstance.var RootModule Moduleinternal/addrs/move_endpoint_module.go1
696:38unchecked-type-assertion
internal/addrs/move_endpoint_module.go:696:38
// by the "to" relative address in toMatch. toRelSubject := toMatch.relSubject.(AbsResourceInstance) var mNew ModuleInstanceinternal/e2e/e2e.go1
41:61unexported-return
internal/e2e/e2e.go:41:61
// function always succeeds.func NewBinary(t *testing.T, binaryPath, workingDir string) *binary { tmpDir, err := filepath.EvalSymlinks(t.TempDir())internal/backend/local/backend_local_test.go1
314:52unused-parameter
internal/backend/local/backend_local_test.go:314:52
func (s *stateStorageThatFailsRefresh) MutateState(fn func(*states.State) *states.State) error { return fmt.Errorf("unimplemented")internal/addrs/check_rule.go1
75:7unused-receiver
internal/addrs/check_rule.go:75:7
func (k checkRuleKey) uniqueKeySigil() {}internal/backend/remote-state/consul/client_test.go1
69:113use-any
internal/backend/remote-state/consul/client_test.go:69:113
// Get the backend b := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/backend_local_test.go1
323:9use-errors-new
internal/backend/local/backend_local_test.go:323:9
func (s *stateStorageThatFailsRefresh) PersistState(_ context.Context, schemas *tofu.Schemas) error { return fmt.Errorf("unimplemented")}internal/command/jsonplan/plan_test.go1
344:3use-slices-sort
internal/command/jsonplan/plan_test.go:344:3
// Sort the slices based on the number of elements in each path sort.Slice(pathsA, func(i, j int) bool { return len(pathsA[i]) < len(pathsA[j])internal/backend/remote-state/azure/client_test.go1
221:2var-naming
internal/backend/remote-state/azure/client_test.go:221:2
client_id := os.Getenv("TF_AZURE_TEST_CLIENT_ID") client_secret := os.Getenv("TF_AZURE_TEST_CLIENT_SECRET") if client_id == "" || client_secret == "" {internal/backend/remote-state/http/client.go1
237:11weak-cryptography
internal/backend/remote-state/http/client.go:237:11
// Generate the MD5 hash := md5.Sum(payload.Data) payload.MD5 = hash[:]internal/addrs/check_rule_diagnostic_test.go1
40:13add-constant
internal/addrs/check_rule_diagnostic_test.go:40:13
Detail: "this is an error", Extra: "extra", })internal/tofu/context_apply_test.go1
3236:5boolean-literal-comparison
internal/tofu/context_apply_test.go:3236:5
defer callLock.Unlock() if called != true { t.Fatalf("err: configure never called")internal/addrs/module_instance.go1
100:6cognitive-complexity
internal/addrs/module_instance.go:100:6
// This function supports module addresses with and without instance keys.func parseModuleInstancePrefix(traversal hcl.Traversal) (ModuleInstance, hcl.Traversal, tfdiags.Diagnostics) { remain := traversalinternal/command/cliconfig/cliconfig.go1
287:6confusing-naming
internal/command/cliconfig/cliconfig.go:287:6
func envConfig(env map[string]string) *Config { config := &Config{}internal/initwd/module_install.go1
1103:56confusing-results
internal/initwd/module_install.go:1103:56
func splitAddrSubdir(addr addrs.ModuleSource) (string, string) { switch addr := addr.(type) {internal/command/views/json/hook.go1
77:6constructor-interface-return
internal/command/views/json/hook.go:77:6
func NewApplyProgress(addr addrs.AbsResourceInstance, action plans.Action, elapsed time.Duration) Hook { return &applyProgress{internal/backend/remote/backend_context.go1
31:56context-as-argument
internal/backend/remote/backend_context.go:31:56
// Refer to the comments of backend.Local for more details about ctx vs stopCtx.func (b *Remote) LocalRun(ctx context.Context, stopCtx context.Context, op *backend.Operation) (*backend.LocalRun, statemgr.Full, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/command/webbrowser/mock.go1
67:2context-stored-in-struct
internal/command/webbrowser/mock.go:67:2
// would naturally complete. Context context.Contextinternal/addrs/move_endpoint_module.go1
567:22cyclomatic-complexity
internal/addrs/move_endpoint_module.go:567:22
// must have matching object types. If not, MoveDestination will panic.func (r AbsResource) MoveDestination(fromMatch, toMatch *MoveEndpointInModule) (AbsResource, bool) { switch fromMatch.ObjectKind() {internal/cloud/e2e/main_test.go1
229:3deep-exit
internal/cloud/e2e/main_test.go:229:3
fmt.Printf("Could not run exec command: %v\n", err) os.Exit(1) }internal/legacy/helper/acctest/random.go1
28:2deprecated-api-usage
internal/legacy/helper/acctest/random.go:28:2
func init() { rand.Seed(time.Now().UTC().UnixNano())}internal/backend/local/testing.go1
225:17discarded-error-result
internal/backend/local/testing.go:225:17
t.Helper() stateMgr, _ := b.StateMgr(t.Context(), backend.DefaultStateName) lockId, err := stateMgr.Lock(t.Context(), statemgr.NewLockInfo())internal/addrs/remove_endpoint.go1
22:1doc-comment-period
internal/addrs/remove_endpoint.go:22:1
// To obtain a full address from a RemoveEndpoint we need to combine it// with any ancestor modules in the configurationtype RemoveEndpoint struct {internal/backend/remote/backend.go1
234:2early-return
internal/backend/remote/backend.go:234:2
// Get the hostname. if val := obj.GetAttr("hostname"); !val.IsNull() && val.AsString() != "" { b.hostname = val.AsString()internal/addrs/module_source_test.go1
411:13error-strings
internal/addrs/module_source_test.go:411:13
if remote.Subdir != "foo" { t.Errorf("FromRegistry modified the receiver; should be pure function") }internal/encryption/method/errors.go1
74:6error-type-naming
internal/encryption/method/errors.go:74:6
// ErrInvalidConfiguration indicates that the method configuration is incorrect.type ErrInvalidConfiguration struct { Cause errorinternal/addrs/check.go1
68:22exported-declaration-comment
internal/addrs/check.go:68:22
func (c ConfigCheck) CheckableKind() CheckableKind { return CheckableCheckinternal/addrs/resource_test.go1
1:1file-length-limit
internal/addrs/resource_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/cloud/state.go1
510:24flag-parameter
internal/cloud/state.go:510:24
// Delete the remote state.func (s *State) Delete(force bool) error {cmd/tofu/webbrowser_nonunix.go1
1:1format
cmd/tofu/webbrowser_nonunix.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt cmd/tofu/webbrowser_nonunix.go`
internal/addrs/module_source_test.go1
491:6function-length
internal/addrs/module_source_test.go:491:6
func TestParseModuleSourceRegistry(t *testing.T) { // We test parseModuleSourceRegistry alone here, in addition to testinginternal/configs/named_values.go1
287:6function-result-limit
internal/configs/named_values.go:287:6
func decodeVariableType(expr hcl.Expression) (cty.Type, *typeexpr.Defaults, VariableParsingMode, hcl.Diagnostics) { if exprIsNativeQuotedString(expr) {internal/addrs/move_endpoint_module.go1
203:2identical-switch-branches
internal/addrs/move_endpoint_module.go:203:2
steps = []ModuleInstanceStep(relSubject.Module) case AbsResourceInstance: steps = []ModuleInstanceStep(relSubject.Module)internal/backend/init/init.go1
25:2import-alias-naming
internal/backend/init/init.go:25:2
backendInmem "github.com/opentofu/opentofu/internal/backend/remote-state/inmem" backendKubernetes "github.com/opentofu/opentofu/internal/backend/remote-state/kubernetes" backendOSS "github.com/opentofu/opentofu/internal/backend/remote-state/oss"internal/backend/remote-state/consul/client_test.go1
149:3import-shadowing
internal/backend/remote-state/consul/client_test.go:149:3
remote, err := c.Get(t.Context()) if err != nil {internal/encryption/keyprovider.go1
32:3inefficient-map-lookup
internal/encryption/keyprovider.go:32:3
if _, ok := v[first]; !ok { v[first] = make(map[string]cty.Value) }internal/registry/client_test.go1
561:37inefficient-sprintf
internal/registry/client_test.go:561:37
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Length", fmt.Sprintf("%d", len(zipContent))) w.WriteHeader(http.StatusOK)internal/backend/remote-state/http/backend_test.go1
135:21insecure-url-scheme
internal/backend/remote-state/http/backend_test.go:135:21
"lock_method": "BLIP", "unlock_address": "http://127.0.0.1:8888/baz", "unlock_method": "BLOOP",internal/providers/provider.go1
87:17interface-method-limit
internal/providers/provider.go:87:17
// having been called.type Configured interface { // A configured provider can do anything a unconfigured provider can.internal/cloud/backend_common.go1
138:8max-control-nesting
internal/cloud/backend_common.go:138:8
case tfe.RunPlanned: if op.Type == backend.OperationTypePlan { continueinternal/cloud/tfe_client_mock.go1
1563:6max-public-structs
internal/cloud/tfe_client_mock.go:1563:6
type MockVariables struct { client *MockClientinternal/backend/backend.go1
366:3modifies-parameter
internal/backend/backend.go:366:3
} else { op.Result = OperationSuccess }internal/dag/marshal.go1
119:44modifies-value-receiver
internal/dag/marshal.go:119:44
func (e edges) Len() int { return len(e) }func (e edges) Swap(i, j int) { e[i], e[j] = e[j], e[i] }cmd/tofu/provider_source_test.go1
27:13nested-structs
cmd/tofu/provider_source_test.go:27:13
func TestProviderSource(t *testing.T) { tests := []struct { name stringinternal/cloud/state.go1
428:4nil-error-return
internal/cloud/state.go:428:4
// If no state exists, then return nil. return nil, nil }internal/backend/remote-state/inmem/client.go1
25:3nil-value-with-nil-error
internal/backend/remote-state/inmem/client.go:25:3
if c.Data == nil { return nil, nil }internal/backend/remote-state/s3/backend.go1
1005:4no-else-after-return
internal/backend/remote-state/s3/backend.go:1005:4
return "", false } else { return val.AsString(), trueinternal/legacy/helper/acctest/random.go1
27:6no-init
internal/legacy/helper/acctest/random.go:27:6
func init() { rand.Seed(time.Now().UTC().UnixNano())internal/backend/remote-state/cos/client.go1
226:3no-naked-return
internal/backend/remote-state/cos/client.go:226:3
err = fmt.Errorf("failed to open file at %v: checksum mismatch, %s != %s", cosFile, check, checksum) return }cmd/tofu/version.go1
19:5no-package-var
cmd/tofu/version.go:19:5
var VersionPrerelease = version.Prereleasecmd/tofu/testing.go1
6:9package-comments
cmd/tofu/testing.go:6:9
package maininternal/encryption/keyprovider/aws_kms/provider_test.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/aws_kms/provider_test.go:6:9
package aws_kms6:9package-naming
internal/encryption/keyprovider/aws_kms/provider_test.go:6:9
package aws_kmsinternal/backend/remote-state/http/client_test.go1
366:14range-value-address
internal/backend/remote-state/http/client_test.go:366:14
client := &httpClient{ UnlockURL: unlockURL,internal/legacy/tofu/state.go1
1057:7receiver-naming
internal/legacy/tofu/state.go:1057:7
// IsRoot says whether or not this module diff is for the root module.func (m *ModuleState) IsRoot() bool { m.Lock()internal/backend/remote/backend_common.go1
44:14redefines-builtin-id
internal/backend/remote/backend_common.go:44:14
// limited by the provided min and max (in milliseconds) durations.func backoff(min, max float64, iter int) time.Duration { backoff := math.Pow(2, float64(iter)/5) * mininternal/addrs/instance_key_test.go1
65:4redundant-conversion
internal/addrs/instance_key_test.go:65:4
// Percent signs that aren't followed by { are not control sequences StringKey(`%hello`), `["%hello"]`,internal/legacy/helper/schema/schema.go1
1704:13simplify-range
internal/legacy/helper/schema/schema.go:1704:13
if m, ok := raw.(map[string]interface{}); ok { for subk, _ := range m { if _, ok := schema[subk]; !ok {internal/configs/configschema/path.go1
47:3single-case-switch
internal/configs/configschema/path.go:47:3
for i, step := range path { switch step := step.(type) { case cty.GetAttrStep:internal/builtin/provisioners/remote-exec/resource_provisioner.go1
218:6slice-preallocation
internal/builtin/provisioners/remote-exec/resource_provisioner.go:218:6
// Open all the scripts var fhs []io.ReadCloser for _, s := range scripts {internal/command/apply.go1
89:2task-comment
internal/command/apply.go:89:2
// FIXME: the -input flag value is needed to initialize the backend and the // operation, but there is no clear path to pass this value down, so weinternal/addrs/module_call.go1
55:1top-level-declaration-order
internal/addrs/module_call.go:55:1
// module block declares.type AbsModuleCall struct { Module ModuleInstanceinternal/addrs/parse_ref.go1
399:33unchecked-type-assertion
internal/addrs/parse_ref.go:399:33
// depending on what we find after this introducer. callInstance := callRef.Subject.(ModuleCallInstance) //nolint:errcheck // This was constructed directly above by call to parseSingleAttrRef callRange := callRef.SourceRangeinternal/engine/planning/execgraph_managed.go1
34:3unexported-return
internal/engine/planning/execgraph_managed.go:34:3
effectiveReplaceOrder resourceInstanceReplaceOrder,) resourceInstanceObjectSubgraph { // Before we go any further we'll just make sure what we've been giveninternal/backend/local/backend_local_test.go1
322:72unused-parameter
internal/backend/local/backend_local_test.go:322:72
func (s *stateStorageThatFailsRefresh) PersistState(_ context.Context, schemas *tofu.Schemas) error { return fmt.Errorf("unimplemented")internal/addrs/count_attr.go1
23:7unused-receiver
internal/addrs/count_attr.go:23:7
func (ca CountAttr) uniqueKeySigil() {}internal/backend/remote-state/consul/client_test.go1
84:112use-any
internal/backend/remote-state/consul/client_test.go:84:112
// create a new backend with gzip b = backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/backend_plan.go1
153:25use-errors-new
internal/backend/local/backend_plan.go:153:25
// to set PlanOutPath without also setting PlanOutBackend. diags = diags.Append(fmt.Errorf( "PlanOutPath set without also setting PlanOutBackend (this is a bug in OpenTofu)"),internal/command/jsonplan/plan_test.go1
347:3use-slices-sort
internal/command/jsonplan/plan_test.go:347:3
}) sort.Slice(pathsB, func(i, j int) bool { return len(pathsB[i]) < len(pathsB[j])internal/backend/remote-state/cos/backend.go1
30:2var-naming
internal/backend/remote-state/cos/backend.go:30:2
const ( PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID" PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY"internal/backend/remote-state/inmem/client.go1
35:9weak-cryptography
internal/backend/remote-state/inmem/client.go:35:9
func (c *RemoteClient) Put(_ context.Context, data []byte) error { md5 := md5.Sum(data)internal/addrs/check_rule_diagnostic_test.go1
57:13add-constant
internal/addrs/check_rule_diagnostic_test.go:57:13
Severity: hcl.DiagError, Summary: "original error", Detail: "this is an error",internal/tofu/context_eval_test.go1
73:5boolean-literal-comparison
internal/tofu/context_eval_test.go:73:5
// should be allowed by the scope. if scope.PureOnly == true { t.Fatal("wrong result: eval should allow impure funcs")internal/addrs/module_instance.go1
430:25cognitive-complexity
internal/addrs/module_instance.go:430:25
// is contained within the receiver.func (m ModuleInstance) TargetContains(other Targetable) bool { switch to := other.(type) {internal/command/cliconfig/credentials.go1
89:18confusing-naming
internal/command/cliconfig/credentials.go:89:18
// a temporary file location when testing.func (c *Config) credentialsSource(helperType string, helper svcauth.CredentialsStore, credentialsFilePath string) *CredentialsSource { configured := map[svchost.Hostname]cty.Value{}internal/legacy/helper/acctest/random.go1
69:46confusing-results
internal/legacy/helper/acctest/random.go:69:46
// returned in OpenSSH format, and the private key is PEM encoded.func RandSSHKeyPair(comment string) (string, string, error) { privateKey, privateKeyPEM, err := genPrivateKey()internal/command/views/json/hook.go1
112:6constructor-interface-return
internal/command/views/json/hook.go:112:6
func NewApplyComplete(addr addrs.AbsResourceInstance, action plans.Action, idKey, idValue string, elapsed time.Duration) Hook { return &applyComplete{internal/cloud/backend_context.go1
31:55context-as-argument
internal/cloud/backend_context.go:31:55
// Refer to the comments of backend.Local for more details about ctx vs stopCtx.func (b *Cloud) LocalRun(ctx context.Context, stopCtx context.Context, op *backend.Operation) (*backend.LocalRun, statemgr.Full, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/encryption/keyprovider/aws_kms/provider.go1
34:2context-stored-in-struct
internal/encryption/keyprovider/aws_kms/provider.go:34:2
svc kmsClient ctx context.Context}internal/addrs/move_endpoint_module.go1
640:30cyclomatic-complexity
internal/addrs/move_endpoint_module.go:640:30
// must have matching object types. If not, MoveDestination will panic.func (r AbsResourceInstance) MoveDestination(fromMatch, toMatch *MoveEndpointInModule) (AbsResourceInstance, bool) { switch fromMatch.ObjectKind() {internal/cloud/e2e/main_test.go1
248:3deep-exit
internal/cloud/e2e/main_test.go:248:3
fmt.Printf("Could not create file: %v\n", err) os.Exit(1) }internal/legacy/tofu/state.go1
828:15deprecated-api-usage
internal/legacy/tofu/state.go:828:15
if err != nil { return nil, errwrap.Wrapf("failed to decode backend config: {{err}}", err) }internal/backend/local/testing.go1
234:6discarded-error-result
internal/backend/local/testing.go:234:6
// in a clean state _ = stateMgr.Unlock(t.Context(), lockId) return trueinternal/addrs/resource.go1
95:1doc-comment-period
internal/addrs/resource.go:95:1
// ImpliedProvider returns the implied provider type name, for e.g. the "aws" in// "aws_instance"func (r Resource) ImpliedProvider() string {internal/backend/unparsed_value.go1
118:3early-return
internal/backend/unparsed_value.go:118:3
if declared { mode = config.ParsingModeinternal/addrs/module_source_test.go1
414:13error-strings
internal/addrs/module_source_test.go:414:13
if registry.Subdir != "" { t.Errorf("FromRegistry modified the given address; should be pure function") }internal/getmodules/file_detector.go1
64:6error-type-naming
internal/getmodules/file_detector.go:64:6
// to use one of the other schemes and thus not a filesystem path at all.type MaybeRelativePathErr struct { Addr stringinternal/addrs/check.go1
85:6exported-declaration-comment
internal/addrs/check.go:85:6
// evaluated on the containing module.type AbsCheck struct { Module ModuleInstanceinternal/backend/local/backend.go1
1:1file-length-limit
internal/backend/local/backend.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/cloud/testing.go1
409:51flag-parameter
internal/cloud/testing.go:409:51
func testServerWithSnapshotsEnabled(t *testing.T, enabled bool) *httptest.Server { skipIfTFENotEnabled(t)internal/addrs/check_rule.go1
1:1format
internal/addrs/check_rule.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt internal/addrs/check_rule.go`
internal/addrs/move_endpoint_module.go1
477:25function-length
internal/addrs/move_endpoint_module.go:477:25
// must have matching object types. If not, MoveDestination will panic.func (m ModuleInstance) MoveDestination(fromMatch, toMatch *MoveEndpointInModule) (ModuleInstance, bool) { // NOTE: This implementation assumes the invariant that fromMatch andinternal/configs/parser_config_dir.go1
134:17function-result-limit
internal/configs/parser_config_dir.go:134:17
// paths to any test files within the module.func (p Parser) ConfigDirFilesWithTests(dir string, testDirectory string) (primary, override, tests []string, diags hcl.Diagnostics) { return p.dirFiles(dir, testDirectory)internal/addrs/move_endpoint_module.go1
205:2identical-switch-branches
internal/addrs/move_endpoint_module.go:205:2
steps = []ModuleInstanceStep(relSubject.Module) case AbsResource: steps = []ModuleInstanceStep(relSubject.Module)internal/backend/init/init.go1
26:2import-alias-naming
internal/backend/init/init.go:26:2
backendKubernetes "github.com/opentofu/opentofu/internal/backend/remote-state/kubernetes" backendOSS "github.com/opentofu/opentofu/internal/backend/remote-state/oss" backendPg "github.com/opentofu/opentofu/internal/backend/remote-state/pg"internal/backend/remote-state/cos/backend.go1
42:2import-shadowing
internal/backend/remote-state/cos/backend.go:42:2
*schema.Backend encryption encryption.StateEncryption credential *common.Credentialinternal/getproviders/package_authentication.go1
271:6inefficient-map-lookup
internal/getproviders/package_authentication.go:271:6
if _, ok := hashes[hash]; !ok { hashes[hash] = &HashDisposition{ ReportedByTrustedMirror: true,internal/registry/client_test.go1
603:37inefficient-sprintf
internal/registry/client_test.go:603:37
// Claim more bytes than we actually send w.Header().Set("Content-Length", fmt.Sprintf("%d", len(zipContent)+100)) w.WriteHeader(http.StatusOK)internal/backend/remote-state/http/client_test.go1
234:16insecure-url-scheme
internal/backend/remote-state/http/client_test.go:234:16
name: "Locking enabled when UnlockURL is set", unlockURL: "http://http-endpoint.com:3333", wantResult: true,internal/providers/provider.go1
160:16interface-method-limit
internal/providers/provider.go:160:16
// component parts (Unconfigured, Configured) for added safety and clarity.type Interface interface { Configuredinternal/cloud/backend_common.go1
147:7max-control-nesting
internal/cloud/backend_common.go:147:7
// Stop searching when we reached the current run. if w.CurrentRun != nil && w.CurrentRun.ID == item.ID { break runlistinternal/cloud/tfe_client_mock.go1
1627:6max-public-structs
internal/cloud/tfe_client_mock.go:1627:6
type MockWorkspaces struct { client *MockClientinternal/backend/init/init.go1
118:3modifies-parameter
internal/backend/init/init.go:118:3
if alias, ok := backendAliases[name]; ok { name = alias }internal/dag/set.go1
29:2modifies-value-receiver
internal/dag/set.go:29:2
func (s Set) Add(v interface{}) { s[hashcode(v)] = v}cmd/tofu/provider_source_test.go1
190:22nested-structs
cmd/tofu/provider_source_test.go:190:22
}) cases := map[string]struct { methodType cliconfig.ProviderInstallationLocationinternal/command/cliconfig/oci_credentials.go1
109:3nil-error-return
internal/command/cliconfig/oci_credentials.go:109:3
log.Printf("[WARN] Problems during OCI registry ambient credentials discovery:\n%s", err.Error()) return nil, nil }internal/backend/remote-state/kubernetes/backend.go1
378:4nil-value-with-nil-error
internal/backend/remote-state/kubernetes/backend.go:378:4
log.Printf("[INFO] Unable to load config file as it doesn't exist at %q", pathErr.Path) return nil, nil }internal/backend/remote-state/s3/backend.go1
1021:4no-else-after-return
internal/backend/remote-state/s3/backend.go:1021:4
return def } else { return vinternal/logging/logging.go1
50:6no-init
internal/logging/logging.go:50:6
func init() { logger = newHCLogger("")internal/backend/remote-state/cos/client.go1
229:2no-naked-return
internal/backend/remote-state/cos/client.go:229:2
return}internal/addrs/instance_key.go1
56:5no-package-var
internal/addrs/instance_key.go:56:5
// of a configuration object that does not use "count" or "for_each" at all.var NoKey InstanceKeycmd/tofu/version.go1
6:9package-comments
cmd/tofu/version.go:6:9
package maininternal/encryption/keyprovider/azure_vault/compliance_test.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/azure_vault/compliance_test.go:6:9
package azure_vault6:9package-naming
internal/encryption/keyprovider/azure_vault/compliance_test.go:6:9
package azure_vaultinternal/backend/remote-state/http/helper_test.go1
51:12range-value-address
internal/backend/remote-state/http/helper_test.go:51:12
t.Run(tt.name, func(t *testing.T) { resp := &http.Response{ Body: io.NopCloser(bytes.NewBufferString(tt.responseBody)),internal/legacy/tofu/state.go1
1064:7receiver-naming
internal/legacy/tofu/state.go:1064:7
// IsDescendent returns true if other is a descendent of this module.func (m *ModuleState) IsDescendent(other *ModuleState) bool { m.Lock()internal/backend/remote/backend_common.go1
44:19redefines-builtin-id
internal/backend/remote/backend_common.go:44:19
// limited by the provided min and max (in milliseconds) durations.func backoff(min, max float64, iter int) time.Duration { backoff := math.Pow(2, float64(iter)/5) * mininternal/addrs/module_source.go1
42:22redundant-conversion
internal/addrs/module_source.go:42:22
var _ ModuleSource = ModuleSourceLocal("")var _ ModuleSource = ModuleSourceRegistry{}internal/legacy/tofu/diff.go1
321:12simplify-range
internal/legacy/tofu/diff.go:321:12
names := make([]string, 0, len(d.Resources)) for name, _ := range d.Resources { names = append(names, name)internal/lang/funcs/datetime.go1
153:3single-case-switch
internal/lang/funcs/datetime.go:153:3
if err != nil { switch err := err.(type) { case *time.ParseError:internal/cloud/backend.go1
1212:6slice-preallocation
internal/cloud/backend.go:1212:6
func (wm WorkspaceMapping) tfeTags() []*tfe.Tag { var tags []*tfe.Taginternal/command/apply.go1
94:2task-comment
internal/command/apply.go:94:2
// FIXME: the -parallelism flag is used to control the concurrency of // OpenTofu operations. At the moment, this value is used both tointernal/addrs/module_instance.go1
30:1top-level-declaration-order
internal/addrs/module_instance.go:30:1
var ( _ Targetable = ModuleInstance(nil)internal/addrs/sync_map.go1
64:13unchecked-type-assertion
internal/addrs/sync_map.go:64:13
} return elem.(MapElem[K, V]).Value}internal/engine/planning/plan_context.go1
86:51unexported-return
internal/engine/planning/plan_context.go:86:51
// not be used anymore.func (p *planContext) Close(ctx context.Context) (*planContextResult, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/backend/local/backend_test.go1
24:21unused-parameter
internal/backend/local/backend_test.go:24:21
func TestLocal_impl(t *testing.T) { var _ backend.Enhanced = New(encryption.StateEncryptionDisabled())internal/addrs/for_each_attr.go1
23:7unused-receiver
internal/addrs/for_each_attr.go:23:7
func (f ForEachAttr) uniqueKeySigil() {}internal/backend/remote-state/consul/client_test.go1
109:113use-any
internal/backend/remote-state/consul/client_test.go:109:113
b := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/hook_state_test.go1
306:10use-errors-new
internal/backend/local/hook_state_test.go:306:10
if schemas == nil { return fmt.Errorf("no schemas") }internal/command/jsonplan/values.go1
173:2use-slices-sort
internal/command/jsonplan/values.go:173:2
} sort.Slice(childModules, func(i, j int) bool { return childModules[i].Address < childModules[j].Addressinternal/backend/remote-state/cos/backend.go1
31:2var-naming
internal/backend/remote-state/cos/backend.go:31:2
PROVIDER_SECRET_ID = "TENCENTCLOUD_SECRET_ID" PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY" PROVIDER_SECURITY_TOKEN = "TENCENTCLOUD_SECURITY_TOKEN"internal/backend/remote-state/kubernetes/client.go1
77:9weak-cryptography
internal/backend/remote-state/kubernetes/client.go:77:9
md5 := md5.Sum(state)internal/addrs/check_rule_diagnostic_test.go1
58:13add-constant
internal/addrs/check_rule_diagnostic_test.go:58:13
Summary: "original error", Detail: "this is an error", Extra: &CheckRuleDiagnosticExtra{version/version_test.go1
17:60boolean-literal-comparison
version/version_test.go:17:60
func TestVersion(t *testing.T) { if match, _ := regexp.MatchString("[^\\d+\\.]", Version); match != false { t.Fatalf("Version should contain only the main version")internal/addrs/module_source_resolve.go1
18:6cognitive-complexity
internal/addrs/module_source_resolve.go:18:6
// combination of two other source addresses, if possible.func ResolveRelativeModuleSource(a, b ModuleSource) (ModuleSource, error) { bLocal, ok := b.(ModuleSourceLocal)internal/command/cliconfig/oci_credentials.go1
39:18confusing-naming
internal/command/cliconfig/oci_credentials.go:39:18
// the discovery environment as an argument so that we can fake it for testing purposes.func (c *Config) ociCredentialsPolicy(ctx context.Context, discoEnv ociauthconfig.ConfigDiscoveryEnvironment) (ociauthconfig.CredentialsConfigs, error) { var cfgs []ociauthconfig.CredentialsConfiginternal/legacy/helper/acctest/random.go1
85:43confusing-results
internal/legacy/helper/acctest/random.go:85:43
// private key, and returns both the cert and the private key PEM encoded.func RandTLSCert(orgName string) (string, string, error) { template := &x509.Certificate{internal/command/views/json/hook.go1
144:6constructor-interface-return
internal/command/views/json/hook.go:144:6
func NewApplyErrored(addr addrs.AbsResourceInstance, action plans.Action, elapsed time.Duration) Hook { return &applyErrored{internal/command/test.go1
925:66context-as-argument
internal/command/test.go:925:66
func (runner *TestFileRunner) wait(ctx *tofu.Context, runningCtx context.Context, run *moduletest.Run, file *moduletest.File, created []*plans.ResourceInstanceChangeSrc) (diags tfdiags.Diagnostics, cancelled bool) { var identifier stringinternal/encryption/keyprovider/azure_vault/provider.go1
36:2context-stored-in-struct
internal/encryption/keyprovider/azure_vault/provider.go:36:2
svc keyManagementClient ctx context.Context keyName stringinternal/addrs/parse_ref.go1
164:6cyclomatic-complexity
internal/addrs/parse_ref.go:164:6
func parseRef(traversal hcl.Traversal) (*Reference, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/cloud/e2e/main_test.go1
253:3deep-exit
internal/cloud/e2e/main_test.go:253:3
fmt.Printf("Could not write credentials: %v\n", err) os.Exit(1) }internal/backend/local/testing.go1
243:17discarded-error-result
internal/backend/local/testing.go:243:17
t.Helper() stateMgr, _ := b.StateMgr(t.Context(), backend.DefaultStateName) lockId, err := stateMgr.Lock(t.Context(), statemgr.NewLockInfo())internal/addrs/sync_map_test.go1
15:1doc-comment-period
internal/addrs/sync_map_test.go:15:1
// Note: this is mostly identical to the Map test in// map_test.gofunc TestSyncMap(t *testing.T) {internal/cloud/backend_taskStages.go1
138:4early-return
internal/cloud/backend_taskStages.go:138:4
cont, err := b.processStageOverrides(ctx, output, stage.ID) if err != nil { errs = multierror.Append(errs, err)internal/addrs/module_source_test.go1
430:13error-strings
internal/addrs/module_source_test.go:430:13
if remote.Subdir != "" { t.Errorf("FromRegistry modified the receiver; should be pure function") }internal/getproviders/errors.go1
19:6error-type-naming
internal/getproviders/errors.go:19:6
// in a provider address does not support the provider registry protocol.type ErrHostNoProviders struct { Hostname svchost.Hostnameinternal/addrs/check.go1
92:19exported-declaration-comment
internal/addrs/check.go:92:19
func (c AbsCheck) UniqueKey() UniqueKey { return absCheckUniqueKey(c.String())internal/backend/local/backend_apply_test.go1
1:1file-length-limit
internal/backend/local/backend_apply_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/command/arguments/taint.go1
38:17flag-parameter
internal/command/arguments/taint.go:38:17
// the best effort interpretation of the arguments.func ParseTaint(isTaint bool, args []string) (*Taint, func(), tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/addrs/check_rule_diagnostic.go1
1:1format
internal/addrs/check_rule_diagnostic.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt internal/addrs/check_rule_diagnostic.go`
internal/addrs/move_endpoint_module_test.go1
18:6function-length
internal/addrs/move_endpoint_module_test.go:18:6
func TestModuleInstanceMoveDestination(t *testing.T) { tests := []struct {internal/configs/parser_config_dir.go1
175:18function-result-limit
internal/configs/parser_config_dir.go:175:18
// main direction and as the location for additional test files.func (p *Parser) dirFiles(dir string, testsDir string) (primary, override, tests []string, diags hcl.Diagnostics) { includeTests := len(testsDir) > 0internal/addrs/move_endpoint_module.go1
239:2identical-switch-branches
internal/addrs/move_endpoint_module.go:239:2
inst = append(inst, sub.Module...) case AbsResourceInstance: inst = append(inst, sub.Module...)internal/backend/init/init.go1
27:2import-alias-naming
internal/backend/init/init.go:27:2
backendOSS "github.com/opentofu/opentofu/internal/backend/remote-state/oss" backendPg "github.com/opentofu/opentofu/internal/backend/remote-state/pg" backendS3 "github.com/opentofu/opentofu/internal/backend/remote-state/s3"internal/backend/remote-state/gcs/backend.go1
33:2import-shadowing
internal/backend/remote-state/gcs/backend.go:33:2
*schema.Backend encryption encryption.StateEncryptioninternal/initwd/module_install.go1
753:3inefficient-map-lookup
internal/initwd/module_install.go:753:3
span.SetAttributes(traceattrs.OpenTofuModuleSource(packageLocation.UILabel())) i.registryPackageSources[moduleAddr] = packageLocation }internal/registry/client_test.go1
664:37inefficient-sprintf
internal/registry/client_test.go:664:37
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Length", fmt.Sprintf("%d", len(zipContent))) w.WriteHeader(http.StatusOK)internal/backend/remote-state/oss/backend.go1
429:90insecure-url-scheme
internal/backend/remote-state/oss/backend.go:429:90
b.otsEndpoint = otsEndpoint parts := strings.Split(strings.TrimPrefix(strings.TrimPrefix(otsEndpoint, "https://"), "http://"), ".") b.otsClient = tablestore.NewClientWithConfig(otsEndpoint, parts[0], accessKey, secretKey, securityToken, tablestore.NewDefaultTableStoreConfig())internal/tofu/eval_context.go1
28:18interface-method-limit
internal/tofu/eval_context.go:28:18
// EvalContext is the interface that is given to eval nodes to execute.type EvalContext interface { // Stopped returns a channel that is closed when evaluation is stoppedinternal/cloud/backend_common.go1
361:7max-control-nesting
internal/cloud/backend_common.go:361:7
if err != nil { if err != io.EOF { return generalError("Failed to read logs", err)internal/command/cliconfig/provider_installation.go1
588:6max-public-structs
internal/command/cliconfig/provider_installation.go:588:6
// a provider_installation block.type ProviderInstallationMethod struct { Location ProviderInstallationLocationinternal/backend/local/backend.go1
332:2modifies-parameter
internal/backend/local/backend.go:332:2
op.StateLocker = op.StateLocker.WithContext(stopCtx)internal/dag/set.go1
51:3modifies-value-receiver
internal/dag/set.go:51:3
if other.Len() < s.Len() { s, other = other, s }cmd/tofu/provider_source_test.go1
289:13nested-structs
cmd/tofu/provider_source_test.go:289:13
func TestConfigureProviderDownloadRetry(t *testing.T) { tests := []struct { name stringinternal/command/views/hook_ui.go1
237:3nil-error-return
internal/command/views/hook_ui.go:237:3
// Errors are collected and printed in ApplyCommand, no need to duplicate return tofu.HookActionContinue, nil }internal/backend/remote-state/kubernetes/client.go1
58:4nil-value-with-nil-error
internal/backend/remote-state/kubernetes/client.go:58:4
if k8serrors.IsNotFound(err) { return nil, nil }internal/backend/remote-state/s3/backend.go1
1059:4no-else-after-return
internal/backend/remote-state/s3/backend.go:1059:4
return nil, false } else { return v, trueinternal/plugin/discovery/version_set.go1
52:6no-init
internal/plugin/discovery/version_set.go:52:6
func init() { AllVersions = Constraints{internal/backend/remote-state/cos/client.go1
292:3no-naked-return
internal/backend/remote-state/cos/client.go:292:3
err = fmt.Errorf("bucket %s not exists", c.bucket) return }internal/addrs/module.go1
34:5no-package-var
internal/addrs/module.go:34:5
// represented by RootModuleInstance.var RootModule Modulecmd/tofu/webbrowser.go1
6:9package-comments
cmd/tofu/webbrowser.go:6:9
package maininternal/encryption/keyprovider/azure_vault/config.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/azure_vault/config.go:6:9
package azure_vault6:9package-naming
internal/encryption/keyprovider/azure_vault/config.go:6:9
package azure_vaultinternal/backend/remote-state/http/helper_test.go1
120:12range-value-address
internal/backend/remote-state/http/helper_test.go:120:12
t.Run(tt.name, func(t *testing.T) { resp := &http.Response{ Header: tt.headers,internal/legacy/tofu/state.go1
1075:7receiver-naming
internal/legacy/tofu/state.go:1075:7
// represent the state of resources that are orphans.func (m *ModuleState) Orphans(c *configs.Module) []addrs.ResourceInstance { m.Lock()internal/cloud/backend_common.go1
42:14redefines-builtin-id
internal/cloud/backend_common.go:42:14
// limited by the provided min and max (in milliseconds) durations.func backoff(min, max float64, iter int) time.Duration { backoff := math.Pow(2, float64(iter)/5) * mininternal/addrs/module_source_test.go1
29:11redundant-conversion
internal/addrs/module_source_test.go:29:11
input: "./child", want: ModuleSourceLocal("./child"), },internal/legacy/tofu/diff.go1
353:12simplify-range
internal/legacy/tofu/diff.go:353:12
keys := make([]string, 0, len(rdiffAttrs)) for key, _ := range rdiffAttrs { if key == "id" {internal/legacy/helper/schema/field_reader_config.go1
331:2single-case-switch
internal/legacy/helper/schema/field_reader_config.go:331:2
switch t := schema.Elem.(type) { case *Resource:internal/cloud/tfe_client_mock.go1
1757:6slice-preallocation
internal/cloud/tfe_client_mock.go:1757:6
var tags []*tfe.Tag for _, tag := range options.Tags {internal/command/cliconfig/cliconfig.go1
344:2task-comment
internal/command/cliconfig/cliconfig.go:344:2
// FIXME: Right now our config parsing doesn't retain enough information // to give proper source references to any errors. We should improveinternal/addrs/module_package.go1
52:1top-level-declaration-order
internal/addrs/module_package.go:52:1
// series of steps in the module installer, with the help of the type checker.type ModuleRegistryPackage = regaddr.ModulePackageinternal/addrs/sync_map.go1
76:13unchecked-type-assertion
internal/addrs/sync_map.go:76:13
} return elem.(MapElem[K, V]).Value, ok}internal/engine/planning/plan_resource_instance.go1
212:80unexported-return
internal/engine/planning/plan_resource_instance.go:212:80
// The caller must not mutate anything accessible through the returned pointer.func (rios *resourceInstanceObjects) Get(addr addrs.AbsResourceInstanceObject) *resourceInstanceObject { return rios.objects.Get(addr)internal/backend/local/backend_test.go1
198:59unused-parameter
internal/backend/local/backend_test.go:198:59
func (b *testDelegateBackend) StateMgr(_ context.Context, name string) (statemgr.Full, error) { if b.stateErr {internal/addrs/input_variable.go1
26:7unused-receiver
internal/addrs/input_variable.go:26:7
func (v InputVariable) uniqueKeySigil() {}internal/backend/remote-state/consul/client_test.go1
195:112use-any
internal/backend/remote-state/consul/client_test.go:195:112
// Test with gzip and chunks b = backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/local/hook_state_test.go1
338:10use-errors-new
internal/backend/local/hook_state_test.go:338:10
if schemas == nil { return fmt.Errorf("no schemas") }internal/command/jsonplan/values.go1
268:2use-slices-sort
internal/command/jsonplan/values.go:268:2
sort.Slice(ret, func(i, j int) bool { return ret[i].Address < ret[j].Addressinternal/backend/remote-state/cos/backend.go1
32:2var-naming
internal/backend/remote-state/cos/backend.go:32:2
PROVIDER_SECRET_KEY = "TENCENTCLOUD_SECRET_KEY" PROVIDER_SECURITY_TOKEN = "TENCENTCLOUD_SECURITY_TOKEN" PROVIDER_REGION = "TENCENTCLOUD_REGION"internal/backend/remote-state/oss/client.go1
126:9weak-cryptography
internal/backend/remote-state/oss/client.go:126:9
sum := md5.Sum(data) if err := c.putMD5(sum[:]); err != nil {internal/addrs/checkable.go1
137:15add-constant
internal/addrs/checkable.go:137:15
Severity: hcl.DiagError, Summary: "Invalid checkable address", Detail: fmt.Sprintf("%s address must follow the module address with the keyword '%s'.", cases.Title(language.English, cases.NoLower).String(keyword), keyword),version/version_test.go1
21:62boolean-literal-comparison
version/version_test.go:21:62
if match, _ := regexp.MatchString("[^a-z\\d]", Prerelease); match != false { t.Fatalf("Prerelease should contain only letters and numbers")internal/addrs/move_endpoint_module.go1
256:32cognitive-complexity
internal/addrs/move_endpoint_module.go:256:32
// the given module to see if they match.func (e *MoveEndpointInModule) SelectsModule(addr ModuleInstance) bool { synthInst := e.synthModuleInstance()internal/command/clistate/local_state.go1
85:22confusing-naming
internal/command/clistate/local_state.go:85:22
}func (s *LocalState) writeState(state *CLIState) error { if s.stateFileOut == nil {internal/legacy/helper/schema/resource_data.go1
91:60confusing-results
internal/legacy/helper/schema/resource_data.go:91:60
// fields which have a zero value of false.func (d *ResourceData) GetChange(key string) (interface{}, interface{}) { o, n := d.getChange(key, getSourceState, getSourceDiff)internal/command/views/json/hook.go1
170:6constructor-interface-return
internal/command/views/json/hook.go:170:6
func NewProvisionStart(addr addrs.AbsResourceInstance, provisioner string) Hook { return &provisionStart{internal/tracing/context_probe.go1
44:41context-as-argument
internal/tracing/context_probe.go:44:41
// record the call in the probe.func NewContextProbe(t testing.TB, base context.Context) (context.Context, *ContextProbe) { if existing := base.Value(contextProbeKey); existing != nil {internal/encryption/keyprovider/gcp_kms/provider.go1
33:2context-stored-in-struct
internal/encryption/keyprovider/gcp_kms/provider.go:33:2
svc keyManagementClient ctx context.Context keyName stringinternal/addrs/parse_ref.go1
283:6cyclomatic-complexity
internal/addrs/parse_ref.go:283:6
func parseResourceRef(mode ResourceMode, startRange hcl.Range, traversal hcl.Traversal) (*Reference, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/cloud/remote_test.go1
29:2deep-exit
internal/cloud/remote_test.go:29:2
os.Exit(m.Run())}internal/backend/local/testing.go1
251:6discarded-error-result
internal/backend/local/testing.go:251:6
// leave the workdir in a clean state _ = stateMgr.Unlock(t.Context(), lockId) t.Error("unexpected success locking state")internal/backend/backend.go1
127:1doc-comment-period
internal/backend/backend.go:127:1
// HostAlias describes a list of aliases that should be used when initializing an// Enhanced Backendtype HostAlias struct {internal/command/e2etest/providers_tamper_test.go1
677:2early-return
internal/command/e2etest/providers_tamper_test.go:677:2
} if lock := locks.Provider(addrs.MustParseProviderSourceString("registry.terraform.io/hashicorp/null")); lock != nil { if got, want := lock.Version(), getproviders.MustParseVersion("3.2.0"); got != want {internal/addrs/module_source_test.go1
433:13error-strings
internal/addrs/module_source_test.go:433:13
if registry.Subdir != "bar" { t.Errorf("FromRegistry modified the given address; should be pure function") }internal/getproviders/errors.go1
45:6error-type-naming
internal/getproviders/errors.go:45:6
// the service discovery protocol.type ErrHostUnreachable struct { Hostname svchost.Hostnameinternal/addrs/check.go1
103:19exported-declaration-comment
internal/addrs/check.go:103:19
// CheckAssertion rules within a check block.func (c AbsCheck) CheckRule(typ CheckRuleType, i int) CheckRule { return CheckRule{internal/backend/local/backend_local.go1
1:1file-length-limit
internal/backend/local/backend_local.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/command/arguments/types.go1
71:64flag-parameter
internal/command/arguments/types.go:71:64
// Commands that only support -json (not -json-into) should pass jsonInto=false.func (v *ViewOptions) AddGranularFlags(cmdFlags *flag.FlagSet, input bool, jsonInto bool) { if input {internal/addrs/check_rule_diagnostic_test.go1
1:1format
internal/addrs/check_rule_diagnostic_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt internal/addrs/check_rule_diagnostic_test.go`
internal/addrs/move_endpoint_module_test.go1
312:6function-length
internal/addrs/move_endpoint_module_test.go:312:6
func TestAbsResourceInstanceMoveDestination(t *testing.T) { tests := []struct {internal/encryption/keyprovider/pbkdf2/config.go1
282:6function-result-limit
internal/encryption/keyprovider/pbkdf2/config.go:282:6
// seen by hcl as a valid reference but as a raw string.func extractChainTraversal(body hcl.Body) (hcl.Traversal, hcl.Body, *hcl.Attribute, hcl.Diagnostics) { var diags hcl.Diagnosticsinternal/addrs/parse_ref.go1
300:2identical-switch-branches
internal/addrs/parse_ref.go:300:2
typeName = tt.Name case hcl.TraverseAttr: typeName = tt.Nameinternal/backend/init/init.go1
28:2import-alias-naming
internal/backend/init/init.go:28:2
backendPg "github.com/opentofu/opentofu/internal/backend/remote-state/pg" backendS3 "github.com/opentofu/opentofu/internal/backend/remote-state/s3" backendCloud "github.com/opentofu/opentofu/internal/cloud"internal/backend/remote-state/gcs/backend_state.go1
32:2import-shadowing
internal/backend/remote-state/gcs/backend_state.go:32:2
func (b *Backend) Workspaces(ctx context.Context) ([]string, error) { states := []string{backend.DefaultStateName}internal/lang/eval.go1
388:6inefficient-map-lookup
internal/lang/eval.go:388:6
if !fnDiags.HasErrors() { hclCtx.Functions[subj.String()] = *fn }internal/registry/client_test.go1
777:37inefficient-sprintf
internal/registry/client_test.go:777:37
receivedAuthHeader = r.Header.Get("Authorization") w.Header().Set("Content-Length", fmt.Sprintf("%d", len(zipContent))) w.WriteHeader(http.StatusOK)internal/backend/remote-state/oss/backend.go1
627:23insecure-url-scheme
internal/backend/remote-state/oss/backend.go:627:23
var securityCredURL = "http://100.100.100.200/latest/meta-data/ram/security-credentials/"internal/tofu/hook.go1
37:11interface-method-limit
internal/tofu/hook.go:37:11
// nothing. Then, override only the functions you want to implement.type Hook interface { // PreApply and PostApply are called before and after an action for ainternal/cloud/backend_common.go1
411:6max-control-nesting
internal/cloud/backend_common.go:411:6
if err != errRunOverridden { if _, err = b.client.PolicyChecks.Override(stopCtx, pc.ID); err != nil { return generalError(fmt.Sprintf("Failed to override policy check.\n%s", runUrl), err)internal/command/cliconfig/provider_installation.go1
650:6max-public-structs
internal/command/cliconfig/provider_installation.go:650:6
// Provider Mirror Protocol.type ProviderInstallationOCIMirror struct { // RepositoryMapping is a function that translates from an OpenTofu-styleinternal/backend/local/backend_apply.go1
88:2modifies-parameter
internal/backend/local/backend_apply.go:88:2
stateHook := new(StateHook) op.Hooks = append(op.Hooks, stateHook)internal/encryption/keyprovider.go1
32:3modifies-value-receiver
internal/encryption/keyprovider.go:32:3
if _, ok := v[first]; !ok { v[first] = make(map[string]cty.Value) }internal/addrs/instance_key_test.go1
14:13nested-structs
internal/addrs/instance_key_test.go:14:13
func TestInstanceKeyString(t *testing.T) { tests := []struct { Key InstanceKeyinternal/configs/configload/module_mgr.go1
50:4nil-error-return
internal/configs/configload/module_mgr.go:50:4
m.manifest = make(modsdir.Manifest) return nil }internal/backend/remote-state/kubernetes/client.go1
67:3nil-value-with-nil-error
internal/backend/remote-state/kubernetes/client.go:67:3
// The secret exists but there is no state in it return nil, nil }internal/backend/remote-state/s3/backend.go1
1067:4no-else-after-return
internal/backend/remote-state/s3/backend.go:1067:4
return "" } else { return vinternal/registry/test/mock_registry.go1
132:6no-init
internal/registry/test/mock_registry.go:132:6
func init() { // Add provider aliasesinternal/backend/remote-state/cos/client.go1
299:3no-naked-return
internal/backend/remote-state/cos/client.go:299:3
err = fmt.Errorf("bucket %s not exists", c.bucket) return }internal/addrs/module_instance.go1
207:5no-package-var
internal/addrs/module_instance.go:207:5
// module, which is also the zero value of ModuleInstance.var RootModuleInstance ModuleInstancecmd/tofu/webbrowser_nonunix.go1
8:9package-comments
cmd/tofu/webbrowser_nonunix.go:8:9
package maininternal/encryption/keyprovider/azure_vault/config_test.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/azure_vault/config_test.go:6:9
package azure_vault6:9package-naming
internal/encryption/keyprovider/azure_vault/config_test.go:6:9
package azure_vaultinternal/backend/remote-state/oss/client_test.go1
407:14range-value-address
internal/backend/remote-state/oss/client_test.go:407:14
t.Run(tt.name, func(t *testing.T) { client := &RemoteClient{ otsTable: tt.otsTable,internal/legacy/tofu/state.go1
1139:7receiver-naming
internal/legacy/tofu/state.go:1139:7
// View returns a view with the given resource prefix.func (m *ModuleState) View(id string) *ModuleState { if m == nil {internal/cloud/backend_common.go1
42:19redefines-builtin-id
internal/cloud/backend_common.go:42:19
// limited by the provided min and max (in milliseconds) durations.func backoff(min, max float64, iter int) time.Duration { backoff := math.Pow(2, float64(iter)/5) * mininternal/addrs/module_source_test.go1
33:11redundant-conversion
internal/addrs/module_source_test.go:33:11
input: "./nope/../child", want: ModuleSourceLocal("./child"), },internal/legacy/tofu/diff.go1
1260:12simplify-range
internal/legacy/tofu/diff.go:1260:12
prefix := k[:len(k)-1] for k2, _ := range d.Attributes { if strings.HasPrefix(k2, prefix) {internal/legacy/helper/schema/schema.go1
895:3single-case-switch
internal/legacy/helper/schema/schema.go:895:3
for attrK, attrV := range unsuppressedDiff.Attributes { switch rd := d.(type) { case *ResourceData:internal/command/arguments/apply_test.go1
408:4slice-preallocation
internal/command/arguments/apply_test.go:408:4
t.Run(name, func(t *testing.T) { targetFileArguments := []string{} wantDiags := tfdiags.Diagnostics{}internal/command/cliconfig/config_unix.go1
65:3task-comment
internal/command/cliconfig/config_unix.go:65:3
if home := os.Getenv("HOME"); home != "" { // FIXME: homeDir gets called from globalPluginDirs during init, before // the logging is set up. We should move meta initialization outside ofinternal/addrs/module_source.go1
42:1top-level-declaration-order
internal/addrs/module_source.go:42:1
var _ ModuleSource = ModuleSourceLocal("")var _ ModuleSource = ModuleSourceRegistry{}internal/addrs/sync_map.go1
92:12unchecked-type-assertion
internal/addrs/sync_map.go:92:12
m.elems.Range(func(_, v any) bool { elem := v.(MapElem[K, V]) return f(elem.Key, elem.Value)internal/engine/planning/plan_resource_instance.go1
361:85unexported-return
internal/engine/planning/plan_resource_instance.go:361:85
func (b *resourceInstanceObjectsBuilder) Get(addr addrs.AbsResourceInstanceObject) (*resourceInstanceObject, bool) { b.mu.Lock()internal/backend/local/backend_test.go1
213:66unused-parameter
internal/backend/local/backend_test.go:213:66
func (b *testDelegateBackend) DeleteWorkspace(_ context.Context, name string, force bool) error { if b.deleteErr {internal/addrs/input_variable.go1
76:7unused-receiver
internal/addrs/input_variable.go:76:7
func (v AbsInputVariableInstance) checkableSigil() {}internal/backend/remote-state/consul/client_test.go1
257:121use-any
internal/backend/remote-state/consul/client_test.go:257:121
// create 2 instances to get 2 remote.Clients sA, err := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/remote-state/azure/backend.go1
120:27use-errors-new
internal/backend/remote-state/azure/backend.go:120:27
if !ok || value < 0 { return nil, []error{fmt.Errorf("timeout_seconds expected to be a non-negative integer")} }internal/command/jsonstate/state.go1
342:2use-slices-sort
internal/command/jsonstate/state.go:342:2
// sort the child modules by address for consistency. sort.Slice(ret, func(i, j int) bool { return ret[i].Address < ret[j].Addressinternal/backend/remote-state/cos/backend.go1
33:2var-naming
internal/backend/remote-state/cos/backend.go:33:2
PROVIDER_SECURITY_TOKEN = "TENCENTCLOUD_SECURITY_TOKEN" PROVIDER_REGION = "TENCENTCLOUD_REGION" PROVIDER_ASSUME_ROLE_ARN = "TENCENTCLOUD_ASSUME_ROLE_ARN"internal/backend/remote-state/oss/client.go1
435:9weak-cryptography
internal/backend/remote-state/oss/client.go:435:9
} sum := md5.Sum(buf.Bytes()) payload := &remote.Payload{internal/addrs/map_test.go1
41:12add-constant
internal/addrs/map_test.go:41:12
if want := pathModule; !keySet.Has(want) { t.Errorf("key set does not include %s", want) }internal/addrs/move_endpoint_module.go1
317:6cognitive-complexity
internal/addrs/move_endpoint_module.go:317:6
// The length of modA must be equal or shorter than the length of modB.func moduleInstanceCanMatch(modA, modB ModuleInstance) bool { for i, step := range modA {internal/command/e2etest/providers_mirror_test.go1
32:6confusing-naming
internal/command/e2etest/providers_mirror_test.go:32:6
func testOpenTofuProvidersMirror(t *testing.T, fixture string) { // This test reaches out to registry.opentofu.org to download theinternal/legacy/helper/schema/resource_data.go1
483:26confusing-results
internal/legacy/helper/schema/resource_data.go:483:26
func (d *ResourceData) diffChange( k string) (interface{}, interface{}, bool, bool, bool) { // Get the change between the state and the config.internal/command/views/json/hook.go1
194:6constructor-interface-return
internal/command/views/json/hook.go:194:6
func NewProvisionProgress(addr addrs.AbsResourceInstance, provisioner string, output string) Hook { return &provisionProgress{internal/legacy/helper/schema/provider.go1
81:2context-stored-in-struct
internal/legacy/helper/schema/provider.go:81:2
stopMu sync.Mutex stopCtx context.Context stopCtxCancel context.CancelFuncinternal/addrs/provider_config.go1
130:6cyclomatic-complexity
internal/addrs/provider_config.go:130:6
// allows an instance key after the alias.func ParseAbsProviderConfigInstance(traversal hcl.Traversal) (AbsProviderConfig, InstanceKey, tfdiags.Diagnostics) { modInst, remain, diags := parseModuleInstancePrefix(traversal)internal/command/cliconfig/svcauthconfig/testdata/helperprog/main.go1
71:2deep-exit
internal/command/cliconfig/svcauthconfig/testdata/helperprog/main.go:71:2
fmt.Fprintf(os.Stderr, f, args...) os.Exit(1)}internal/backend/remote-state/azure/auth/msi_auth.go1
66:2discarded-error-result
internal/backend/remote-state/azure/auth/msi_auth.go:66:2
func (credWrapper *msiTokenCredentialWrapper) GetToken(ctx context.Context, options policy.TokenRequestOptions) (token azcore.AccessToken, err error) { os.Setenv(MSI_ENDPOINT, credWrapper.Endpoint) token, err = credWrapper.cred.GetToken(ctx, options)internal/backend/local/backend_plan_test.go1
120:1doc-comment-period
internal/backend/local/backend_plan_test.go:120:1
// This test validates the state lacking behavior when the inner call to// Context() failsfunc TestLocal_plan_context_error(t *testing.T) {internal/command/meta_backend.go1
140:3early-return
internal/command/meta_backend.go:140:3
if err != nil { if errs := providerPluginErrors(nil); errors.As(err, &errs) { // This is a special type returned by m.providerFactories, whichinternal/addrs/provider_config_test.go1
187:14error-strings
internal/addrs/provider_config_test.go:187:14
if test.WantKey != key { t.Errorf("Wanted key %s, got key %s", test.WantKey, key) }internal/getproviders/errors.go1
63:6error-type-naming
internal/getproviders/errors.go:63:6
// error response when we tried to access it.type ErrUnauthorized struct { Hostname svchost.Hostnameinternal/addrs/check.go1
119:19exported-declaration-comment
internal/addrs/check.go:119:19
func (c AbsCheck) CheckableKind() CheckableKind { return CheckableCheckinternal/backend/local/backend_plan_test.go1
1:1file-length-limit
internal/backend/local/backend_plan_test.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0internal/command/arguments/types.go1
71:76flag-parameter
internal/command/arguments/types.go:71:76
// Commands that only support -json (not -json-into) should pass jsonInto=false.func (v *ViewOptions) AddGranularFlags(cmdFlags *flag.FlagSet, input bool, jsonInto bool) { if input {internal/addrs/checkable.go1
1:1format
internal/addrs/checkable.go:1:1
// Copyright (c) The OpenTofu Authors// SPDX-License-Identifier: MPL-2.0- Fix (safe): run `strider fmt internal/addrs/checkable.go`
internal/addrs/move_endpoint_module_test.go1
709:6function-length
internal/addrs/move_endpoint_module_test.go:709:6
func TestAbsResourceMoveDestination(t *testing.T) { tests := []struct {internal/engine/applying/operations.go1
72:6function-result-limit
internal/engine/applying/operations.go:72:6
func compileExecutionGraph(ctx context.Context, plan *plans.Plan, oracle *eval.ApplyOracle, plugins plugins.Plugins) (*execgraph.Graph, *execgraph.CompiledGraph, *execOperations, tfdiags.Diagnostics) { var diags tfdiags.Diagnosticsinternal/addrs/parse_target.go1
199:2identical-switch-branches
internal/addrs/parse_target.go:199:2
typeName = tt.Name case hcl.TraverseAttr: typeName = tt.Nameinternal/backend/init/init.go1
29:2import-alias-naming
internal/backend/init/init.go:29:2
backendS3 "github.com/opentofu/opentofu/internal/backend/remote-state/s3" backendCloud "github.com/opentofu/opentofu/internal/cloud" "github.com/opentofu/opentofu/internal/encryption"internal/backend/remote-state/http/backend.go1
160:2import-shadowing
internal/backend/remote-state/http/backend.go:160:2
*schema.Backend encryption encryption.StateEncryptioninternal/lang/exprs/evaluate.go1
99:7inefficient-map-lookup
internal/lang/exprs/evaluate.go:99:7
if _, ok := currentChildren[step.Name]; !ok { currentChildren[step.Name] = &symbolTableTempNode{ children: make(map[string]*symbolTableTempNode),internal/registry/client_test.go1
820:37inefficient-sprintf
internal/registry/client_test.go:820:37
receivedAuthHeader = r.Header.Get("Authorization") w.Header().Set("Content-Length", fmt.Sprintf("%d", len(zipContent))) w.WriteHeader(http.StatusOK)internal/backend/remote-state/oss/backend_test.go1
268:22insecure-url-scheme
internal/backend/remote-state/oss/backend_test.go:268:22
name: "should set proxy using http_proxy environment variable", rawUrl: "http://example.com", httpProxy: "http://foo.bar:3128",internal/cloud/backend_context.go1
135:7max-control-nesting
internal/cloud/backend_context.go:135:7
if v.Category == tfe.CategoryTerraform { if _, ok := op.Variables[v.Key]; !ok { op.Variables[v.Key] = &remoteStoredVariableValue{internal/command/jsonentities/diagnostic.go1
126:6max-public-structs
internal/command/jsonentities/diagnostic.go:126:6
// being included as part of a diagnostic snippet.type DiagnosticFunctionCall struct { // CalledAs is the full name that was used to call this function,internal/backend/local/backend_apply.go1
103:4modifies-parameter
internal/backend/local/backend_apply.go:103:4
op.View.Diagnostics(diags) runningOp.Result = backend.OperationFailure }internal/encryption/keyprovider.go1
34:2modifies-value-receiver
internal/encryption/keyprovider.go:34:2
} v[first][second] = value}internal/addrs/module_instance_test.go1
35:17nested-structs
internal/addrs/module_instance_test.go:35:17
func TestModuleInstanceEqual_false(t *testing.T) { testCases := []struct { left stringinternal/copy/copy_dir.go1
160:4nil-error-return
internal/copy/copy_dir.go:160:4
if os.IsNotExist(err) { return false, nil }internal/backend/remote-state/kubernetes/client.go1
255:3nil-value-with-nil-error
internal/backend/remote-state/kubernetes/client.go:255:3
if len(lockData) == 0 || !ok { return nil, nil }internal/backend/remote-state/s3/backend.go1
1080:4no-else-after-return
internal/backend/remote-state/s3/backend.go:1080:4
return "", false } else { return v, trueinternal/tfdiags/rpc_friendly.go1
67:6no-init
internal/tfdiags/rpc_friendly.go:67:6
func init() { gob.Register((*rpcFriendlyDiag)(nil))internal/backend/remote-state/cos/client.go1
303:3no-naked-return
internal/backend/remote-state/cos/client.go:303:3
if err != nil { return }internal/addrs/module_source.go1
46:5no-package-var
internal/addrs/module_source.go:46:5
var moduleSourceLocalPrefixes = []string{ "./",cmd/tofu/webbrowser_unix.go1
8:9package-comments
cmd/tofu/webbrowser_unix.go:8:9
package maininternal/encryption/keyprovider/azure_vault/descriptor.go2
6:9package-directory-mismatch
internal/encryption/keyprovider/azure_vault/descriptor.go:6:9
package azure_vault6:9package-naming
internal/encryption/keyprovider/azure_vault/descriptor.go:6:9
package azure_vaultinternal/backend/remote-state/s3/backend_test.go1
1060:107range-value-address
internal/backend/remote-state/s3/backend_test.go:1060:107
case false: gotProxyURL, err := b.(*Backend).awsConfig.HTTPClient.(*awshttp.BuildableClient).GetTransport().Proxy(&http.Request{ URL: newURL(tc.calledURL),internal/legacy/tofu/state.go1
1156:7receiver-naming
internal/legacy/tofu/state.go:1156:7
func (m *ModuleState) init() { m.Lock()internal/cloud/cloudplan/saved_plan_test.go1
74:5redefines-builtin-id
internal/cloud/cloudplan/saved_plan_test.go:74:5
// os.Stat() wants path to file _, error := os.Stat(tmpFile.Name()) if error != nil {internal/addrs/module_source_test.go1
37:11redundant-conversion
internal/addrs/module_source_test.go:37:11
input: "../sibling", want: ModuleSourceLocal("../sibling"), },internal/legacy/tofu/diff.go1
1300:9simplify-range
internal/legacy/tofu/diff.go:1300:9
checkNew := make(map[string]struct{}) for k, _ := range d.Attributes { checkOld[k] = struct{}{}internal/tofu/node_resource_abstract_instance.go1
454:3single-case-switch
internal/tofu/node_resource_abstract_instance.go:454:3
for _, ref := range preventDestroyRefs { switch addr := ref.Subject.(type) { case addrs.ForEachAttr, addrs.CountAttr:internal/command/arguments/apply_test.go1
586:4slice-preallocation
internal/command/arguments/apply_test.go:586:4
t.Run(name, func(t *testing.T) { excludeFileArguments := []string{} wantDiags := tfdiags.Diagnostics{}internal/command/cliconfig/oci_credentials.go1
552:3task-comment
internal/command/cliconfig/oci_credentials.go:552:3
case oauth: // FIXME: Is refresh_roken actually required? We could potentially allow setting // only access_token and let the request just immediately fail if the token has expired.internal/addrs/move_endpoint_kind.go1
16:1top-level-declaration-order
internal/addrs/move_endpoint_kind.go:16:1
const ( // MoveEndpointModule indicates that a move endpoint either refers tointernal/backend/remote-state/azure/backend.go1
263:28unchecked-type-assertion
internal/backend/remote-state/azure/backend.go:263:28
ValidateFunc: func(v any, _ string) ([]string, []error) { _, err := newCPKInfo(v.(string)) if err != nil {internal/engine/planning/plan_resource_instance.go1
402:50unexported-return
internal/engine/planning/plan_resource_instance.go:402:50
func (b *resourceInstanceObjectsBuilder) Close() *resourceInstanceObjects { b.mu.Lock()internal/backend/local/backend_test.go1
213:79unused-parameter
internal/backend/local/backend_test.go:213:79
func (b *testDelegateBackend) DeleteWorkspace(_ context.Context, name string, force bool) error { if b.deleteErr {internal/addrs/input_variable.go1
93:7unused-receiver
internal/addrs/input_variable.go:93:7
func (v AbsInputVariableInstance) CheckableKind() CheckableKind { return CheckableInputVariableinternal/backend/remote-state/consul/client_test.go1
265:121use-any
internal/backend/remote-state/consul/client_test.go:265:121
sB, err := backend.TestBackendConfig(t, New(encryption.StateEncryptionDisabled()), backend.TestWrapConfig(map[string]interface{}{ "address": srv.HTTPAddr,internal/backend/remote-state/azure/backend_state.go1
49:10use-errors-new
internal/backend/remote-state/azure/backend_state.go:49:10
if name == backend.DefaultStateName || name == "" { return fmt.Errorf("can't delete default state") }internal/command/jsonstate/state.go1
356:2use-slices-sort
internal/command/jsonstate/state.go:356:2
} sort.Slice(sortedResources, func(i, j int) bool { return sortedResources[i].Addr.Less(sortedResources[j].Addr)internal/backend/remote-state/cos/backend.go1
34:2var-naming
internal/backend/remote-state/cos/backend.go:34:2
PROVIDER_REGION = "TENCENTCLOUD_REGION" PROVIDER_ASSUME_ROLE_ARN = "TENCENTCLOUD_ASSUME_ROLE_ARN" PROVIDER_ASSUME_ROLE_SESSION_NAME = "TENCENTCLOUD_ASSUME_ROLE_SESSION_NAME"internal/backend/remote-state/oss/client_test.go1
245:9weak-cryptography
internal/backend/remote-state/oss/client_test.go:245:9
sum := md5.Sum([]byte("test"))internal/addrs/map_test.go1
56:37add-constant
internal/addrs/map_test.go:56:37
} if got, want := m.Get(localHello), "hello"; got != want { t.Errorf("unexpected value %q for %s; want %q", got, localHello, want)internal/addrs/move_endpoint_module.go1
340:32cognitive-complexity
internal/addrs/move_endpoint_module.go:340:32
// is the "from" of another statement.func (e *MoveEndpointInModule) CanChainFrom(other *MoveEndpointInModule) bool { eMod := e.synthModuleInstance()internal/command/jsonconfig/config.go1
144:6confusing-naming
internal/command/jsonconfig/config.go:144:6
// treatment through the centralized doc comment.func marshal(c *configs.Config, schemas *tofu.Schemas) ([]byte, error) { var output configinternal/legacy/helper/schema/resource_data.go1
483:45confusing-results
internal/legacy/helper/schema/resource_data.go:483:45
func (d *ResourceData) diffChange( k string) (interface{}, interface{}, bool, bool, bool) { // Get the change between the state and the config.internal/command/views/json/hook.go1
218:6constructor-interface-return
internal/command/views/json/hook.go:218:6
func NewProvisionComplete(addr addrs.AbsResourceInstance, provisioner string) Hook { return &provisionComplete{internal/legacy/helper/schema/provisioner.go1
53:2context-stored-in-struct
internal/legacy/helper/schema/provisioner.go:53:2
stopCtx context.Context stopCtxCancel context.CancelFuncinternal/addrs/sync_map_test.go1
16:6cyclomatic-complexity
internal/addrs/sync_map_test.go:16:6
// map_test.gofunc TestSyncMap(t *testing.T) { variableName := InputVariable{Name: "name"}internal/command/command_test.go1
92:2deep-exit
internal/command/command_test.go:92:2
os.Exit(m.Run())}