All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.plugins.csharp.CSharpPropertyDefinitions Maven / Gradle / Ivy

There is a newer version: 10.2.0.105762
Show newest version
/*
 * SonarC#
 * Copyright (C) 2014-2024 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
package org.sonar.plugins.csharp;

import org.sonar.api.PropertyType;
import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.resources.Qualifiers;
import org.sonarsource.dotnet.shared.plugins.AbstractPropertyDefinitions;

import java.util.List;

public class CSharpPropertyDefinitions extends AbstractPropertyDefinitions {

  public CSharpPropertyDefinitions() {
    super(CSharpPlugin.LANGUAGE_KEY, CSharpPlugin.LANGUAGE_NAME, CSharpPlugin.FILE_SUFFIXES_DEFVALUE);
  }

  @Override
  public List create() {
    List result = super.create();
    result.add(
      PropertyDefinition.builder(getAnalyzeRazorCode(CSharpPlugin.LANGUAGE_KEY))
        .category(CSharpPlugin.LANGUAGE_NAME)
        .defaultValue("true")
        .name("Analyze Razor code")
        .description("If set to \"true\", .razor and .cshtml files will be fully analysed, this may increase the analysis time." +
          " If set to \"false\", .cshtml files will be analysed for taint vulnerabilities only.")
        .onQualifiers(Qualifiers.PROJECT)
        .type(PropertyType.BOOLEAN)
        .build());
    return result;
  }

  public static String getAnalyzeRazorCode(String languageKey) {
    return PROP_PREFIX + languageKey + ".analyzeRazorCode";
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy