test_class.declarator: RULE_ID1 = "AnyCheck1"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID1 = "AnyCheck1";
test_class.type: String
test_class.var_name: RULE_ID1
test_class.declarator: RULE_ID2 = "AnyCheck2"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID2 = "AnyCheck2";
test_class.type: String
test_class.var_name: RULE_ID2
test_class.declarator: ruleKey1 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID1)
test_class.modifier: private final
test_class.original_string: private final RuleKey ruleKey1 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID1);
test_class.type: RuleKey
test_class.var_name: ruleKey1
test_class.declarator: ruleKey2 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID2)
test_class.modifier: private final
test_class.original_string: private final RuleKey ruleKey2 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID2);
test_class.type: RuleKey
test_class.var_name: ruleKey2
test_class.declarator: sensor
test_class.modifier: private
test_class.original_string: private AnsibleExtraSensor sensor;
test_class.type: AnsibleExtraSensor
test_class.var_name: sensor
test_class.declarator: context
test_class.modifier: private
test_class.original_string: private SensorContextTester context;
test_class.type: SensorContextTester
test_class.var_name: context
test_class.declarator: temporaryFolder = new TemporaryFolder()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder temporaryFolder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: temporaryFolder
test_class.file: sonar-ansible-api/src/test/java/com/github/sbaudoin/sonar/plugins/ansible/extras/rules/AnsibleExtraSensorTest.java
test_class.identifier: AnsibleExtraSensorTest
test_case.body: @Test
      public void testDeleteDirectory() throws IOException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
          // Make the method public for test purpose
          Method method = AnsibleExtraSensor.class.getDeclaredMethod("deleteDirectory", Path.class);
          method.setAccessible(true);
  
          // Create a temporary directory and copy some files
          Path tempDir = Files.createTempDirectory(EXTRA_RULES_TEMP_DIR);
          Path copyFile = tempDir.resolve(Paths.get("extra-rule1.sh"));
          Files.copy(Paths.get("src/test/resources/extra-rules/extra-rule1.sh"), copyFile);
  
          assertTrue((Boolean)method.invoke(sensor, tempDir));
          assertFalse(tempDir.toFile().exists());
      }
test_case.class_method_signature: AnsibleExtraSensorTest.testDeleteDirectory()
test_case.full_signature: @Test public void testDeleteDirectory()
test_case.identifier: testDeleteDirectory
test_case.invocations: getDeclaredMethod setAccessible createTempDirectory resolve get copy get assertTrue invoke assertFalse exists toFile
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDeleteDirectory()
focal_class.declarator: EXTRA_RULES_TEMP_DIR = "ansible-lint-extra-rules"
focal_class.modifier: public static final
focal_class.original_string: public static final String EXTRA_RULES_TEMP_DIR = "ansible-lint-extra-rules";
focal_class.type: String
focal_class.var_name: EXTRA_RULES_TEMP_DIR
focal_class.declarator: EXTRA_RULES_DIR = "extra-rules"
focal_class.modifier: public static final
focal_class.original_string: public static final String EXTRA_RULES_DIR = "extra-rules";
focal_class.type: String
focal_class.var_name: EXTRA_RULES_DIR
focal_class.declarator: LOGGER = Loggers.get(AnsibleExtraSensor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Loggers.get(AnsibleExtraSensor.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: sonar-ansible-api/src/main/java/com/github/sbaudoin/sonar/plugins/ansible/extras/rules/AnsibleExtraSensor.java
focal_class.identifier: AnsibleExtraSensor
focal_class.class_method_signature: AnsibleExtraSensor.AnsibleExtraSensor(FileSystem fileSystem)
focal_class.full_signature: public  AnsibleExtraSensor(FileSystem fileSystem)
focal_class.identifier: AnsibleExtraSensor
focal_class.modifiers: public
focal_class.parameters: (FileSystem fileSystem)
focal_class.signature:  AnsibleExtraSensor(FileSystem fileSystem)
focal_class.class_method_signature: AnsibleExtraSensor.describe(SensorDescriptor descriptor)
focal_class.full_signature: @Override public void describe(SensorDescriptor descriptor)
focal_class.identifier: describe
focal_class.modifiers: @Override public
focal_class.parameters: (SensorDescriptor descriptor)
focal_class.return: void
focal_class.signature: void describe(SensorDescriptor descriptor)
focal_class.class_method_signature: AnsibleExtraSensor.execute(SensorContext context)
focal_class.full_signature: @Override public void execute(SensorContext context)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (SensorContext context)
focal_class.return: void
focal_class.signature: void execute(SensorContext context)
focal_class.class_method_signature: AnsibleExtraSensor.extractExtraRules(String extraRulesDirectory)
focal_class.full_signature: private Path extractExtraRules(String extraRulesDirectory)
focal_class.identifier: extractExtraRules
focal_class.modifiers: private
focal_class.parameters: (String extraRulesDirectory)
focal_class.return: Path
focal_class.signature: Path extractExtraRules(String extraRulesDirectory)
focal_class.class_method_signature: AnsibleExtraSensor.copyExtraRule(Path ruleFile, Path directory)
focal_class.full_signature: private boolean copyExtraRule(Path ruleFile, Path directory)
focal_class.identifier: copyExtraRule
focal_class.modifiers: private
focal_class.parameters: (Path ruleFile, Path directory)
focal_class.return: boolean
focal_class.signature: boolean copyExtraRule(Path ruleFile, Path directory)
focal_class.class_method_signature: AnsibleExtraSensor.deleteDirectory(Path directory)
focal_class.full_signature: private boolean deleteDirectory(Path directory)
focal_class.identifier: deleteDirectory
focal_class.modifiers: private
focal_class.parameters: (Path directory)
focal_class.return: boolean
focal_class.signature: boolean deleteDirectory(Path directory)
focal_class.superclass: extends AbstractAnsibleSensor
focal_method.body: private boolean deleteDirectory(Path directory) {
          try {
              Files.walkFileTree(directory, new SimpleFileVisitor<Path>() {
                  @Override
                  public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                      Files.delete(file);
                      return FileVisitResult.CONTINUE;
                  }
  
                  @Override
                  public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
                      Files.delete(dir);
                      return FileVisitResult.CONTINUE;
                  }
              });
          } catch (IOException e) {
              LOGGER.warn("Cannot delete temporary directory: " + e.getMessage());
              return false;
          }
  
          return true;
      }
focal_method.class_method_signature: AnsibleExtraSensor.deleteDirectory(Path directory)
focal_method.full_signature: private boolean deleteDirectory(Path directory)
focal_method.identifier: deleteDirectory
focal_method.invocations: walkFileTree delete delete warn getMessage
focal_method.modifiers: private
focal_method.parameters: (Path directory)
focal_method.return: boolean
focal_method.signature: boolean deleteDirectory(Path directory)