test_class.file: sonar-php-plugin/src/test/java/org/sonar/plugins/php/PHPProfileDefinitionTest.java
test_class.identifier: PHPProfileDefinitionTest
test_case.body: @Test
    public void should_create_sonar_way_profile() {
      ValidationMessages validation = ValidationMessages.create();
  
      SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(7, 3), SonarQubeSide.SERVER, SonarEdition.COMMUNITY);
      BuiltInQualityProfilesDefinition.Context context = new BuiltInQualityProfilesDefinition.Context();
      PHPProfileDefinition definition = new PHPProfileDefinition(sonarRuntime);
      definition.define(context);
      BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("php", "Sonar way");
      assertThat(profile.language()).isEqualTo(Php.KEY);
      assertThat(profile.name()).isEqualTo(PHPProfileDefinition.SONAR_WAY_PROFILE);
      assertThat(profile.rules().size()).isGreaterThan(50);
      assertThat(profile.rules().size()).isLessThan(CheckList.getAllChecks().size());
      assertThat(profile.rules()).extracting("ruleKey").contains("DuplicatedBlocks");
      assertThat(validation.hasErrors()).isFalse();
    }
test_case.class_method_signature: PHPProfileDefinitionTest.should_create_sonar_way_profile()
test_case.full_signature: @Test public void should_create_sonar_way_profile()
test_case.identifier: should_create_sonar_way_profile
test_case.invocations: create forSonarQube create define profile isEqualTo assertThat language isEqualTo assertThat name isGreaterThan assertThat size rules isLessThan assertThat size rules size getAllChecks contains extracting assertThat rules isFalse assertThat hasErrors
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void should_create_sonar_way_profile()
focal_class.declarator: LOG = Loggers.get(PHPProfileDefinition.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOG = Loggers.get(PHPProfileDefinition.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: SONAR_WAY_PROFILE = "Sonar way"
focal_class.modifier: public static final
focal_class.original_string: public static final String SONAR_WAY_PROFILE = "Sonar way";
focal_class.type: String
focal_class.var_name: SONAR_WAY_PROFILE
focal_class.declarator: SONAR_WAY_PATH = "org/sonar/l10n/php/rules/php/Sonar_way_profile.json"
focal_class.modifier: public static final
focal_class.original_string: public static final String SONAR_WAY_PATH = "org/sonar/l10n/php/rules/php/Sonar_way_profile.json";
focal_class.type: String
focal_class.var_name: SONAR_WAY_PATH
focal_class.declarator: sonarRuntime
focal_class.modifier: private final
focal_class.original_string: private final SonarRuntime sonarRuntime;
focal_class.type: SonarRuntime
focal_class.var_name: sonarRuntime
focal_class.file: sonar-php-plugin/src/main/java/org/sonar/plugins/php/PHPProfileDefinition.java
focal_class.identifier: PHPProfileDefinition
focal_class.interfaces: implements BuiltInQualityProfilesDefinition
focal_class.class_method_signature: PHPProfileDefinition.PHPProfileDefinition(SonarRuntime sonarRuntime)
focal_class.full_signature: public  PHPProfileDefinition(SonarRuntime sonarRuntime)
focal_class.identifier: PHPProfileDefinition
focal_class.modifiers: public
focal_class.parameters: (SonarRuntime sonarRuntime)
focal_class.signature:  PHPProfileDefinition(SonarRuntime sonarRuntime)
focal_class.class_method_signature: PHPProfileDefinition.define(Context context)
focal_class.full_signature: @Override public void define(Context context)
focal_class.identifier: define
focal_class.modifiers: @Override public
focal_class.parameters: (Context context)
focal_class.return: void
focal_class.signature: void define(Context context)
focal_class.class_method_signature: PHPProfileDefinition.getSecurityRuleKeys()
focal_class.full_signature: @VisibleForTesting static Set<RuleKey> getSecurityRuleKeys()
focal_class.identifier: getSecurityRuleKeys
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: ()
focal_class.return: Set<RuleKey>
focal_class.signature: Set<RuleKey> getSecurityRuleKeys()
focal_class.class_method_signature: PHPProfileDefinition.securityRuleMessage(Exception e)
focal_class.full_signature: private static String securityRuleMessage(Exception e)
focal_class.identifier: securityRuleMessage
focal_class.modifiers: private static
focal_class.parameters: (Exception e)
focal_class.return: String
focal_class.signature: String securityRuleMessage(Exception e)
focal_method.body: @Override
    public void define(Context context) {
      NewBuiltInQualityProfile sonarWay = context.createBuiltInQualityProfile(SONAR_WAY_PROFILE, Php.KEY);
      sonarWay.activateRule("common-" + Php.KEY, "DuplicatedBlocks");
      BuiltInQualityProfileJsonLoader.load(sonarWay, CheckList.REPOSITORY_KEY, SONAR_WAY_PATH, RESOURCE_BASE_PATH, sonarRuntime);
      getSecurityRuleKeys().forEach(key -> sonarWay.activateRule(key.repository(), key.rule()));
      sonarWay.done();
    }
focal_method.class_method_signature: PHPProfileDefinition.define(Context context)
focal_method.full_signature: @Override public void define(Context context)
focal_method.identifier: define
focal_method.invocations: createBuiltInQualityProfile activateRule load forEach getSecurityRuleKeys activateRule repository rule done
focal_method.modifiers: @Override public
focal_method.parameters: (Context context)
focal_method.return: void
focal_method.signature: void define(Context context)