func GetScanProperties()

in internal/core/properties.go [121:186]


func GetScanProperties(c corescan.Context) []string {
	yaml := c.QodanaYamlConfig()
	yamlProps := yaml.Properties
	dotNetOptions := yaml.DotNet
	plugins := getPluginIds(yaml.Plugins)

	lines := GetCommonProperties(c)

	lines = append(
		lines,
		fmt.Sprintf("-Xlog:gc*:%s", strutil.QuoteIfSpace(filepath.Join(c.LogDir(), "gc.log"))),
	)

	if c.JvmDebugPort() > 0 {
		lines = append(
			lines,
			fmt.Sprintf("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:%s", containerJvmDebugPort),
		)
	}

	customPluginPathsValue := getCustomPluginPaths(c.Prod())
	if customPluginPathsValue != "" {
		lines = append(lines, fmt.Sprintf("-Dplugin.path=%s", customPluginPathsValue))
	}
	disabledPluginsFile := c.Prod().DisabledPluginsFilePath()
	if _, err := os.Stat(disabledPluginsFile); err == nil {
		lines = append(lines, fmt.Sprintf("-Ddisabled.plugins.file.path=%s", disabledPluginsFile))
	}

	cliProps, flags := c.PropertiesAndFlags()
	for _, f := range flags {
		if f != "" && !strutil.Contains(lines, f) {
			lines = append(lines, f)
		}
	}

	props := getPropertiesMap(
		c.Prod().ParentPrefix(),
		dotNetOptions,
		platform.GetDeviceIdSalt(),
		plugins,
		c.AnalysisId(),
		c.CoverageDir(),
		c.ProjectDirPathRelativeToRepositoryRoot(),
	)
	for k, v := range yamlProps { // qodana.yaml – overrides vmoptions
		if !strings.HasPrefix(k, "-") {
			k = fmt.Sprintf("-D%s", k)
		}
		props[k] = v
	}
	for k, v := range cliProps { // CLI – overrides anything
		if !strings.HasPrefix(k, "-") {
			k = fmt.Sprintf("-D%s", k)
		}
		props[k] = v
	}

	for k, v := range props {
		lines = append(lines, fmt.Sprintf("%s=%s", k, v))
	}

	sort.Strings(lines)

	return lines
}