test_class.declarator: RULE_ID1 = "ANSIBLE1"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID1 = "ANSIBLE1";
test_class.type: String
test_class.var_name: RULE_ID1
test_class.declarator: RULE_ID2 = "EAnyCheck1"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID2 = "EAnyCheck1";
test_class.type: String
test_class.var_name: RULE_ID2
test_class.declarator: RULE_ID3 = "EAnyCheck2"
test_class.modifier: private static final
test_class.original_string: private static final String RULE_ID3 = "EAnyCheck2";
test_class.type: String
test_class.var_name: RULE_ID3
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: ruleKey3 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID3)
test_class.modifier: private final
test_class.original_string: private final RuleKey ruleKey3 = RuleKey.of(AnsibleCheckRepository.REPOSITORY_KEY, RULE_ID3);
test_class.type: RuleKey
test_class.var_name: ruleKey3
test_class.declarator: sensor
test_class.modifier: private
test_class.original_string: private MySensor sensor;
test_class.type: MySensor
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.declarator: logTester = new LogTester()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public LogTester logTester = new LogTester();
test_class.type: LogTester
test_class.var_name: logTester
test_class.file: sonar-ansible-api/src/test/java/com/github/sbaudoin/sonar/plugins/ansible/rules/AbstractAnsibleSensorTest.java
test_class.identifier: AbstractAnsibleSensorTest
test_case.body: @Test
      public void testSaveIssues() throws Exception {
          InputFile playbook1 = Utils.getInputFile("playbooks/playbook1.yml");
          InputFile playbook2 = Utils.getInputFile("playbooks/playbook2.yml");
          InputFile playbook3 = Utils.getInputFile("playbooks/playbook3.yml");
          sensor.scannedFiles.add(playbook1);
          sensor.scannedFiles.add(playbook2);
          sensor.scannedFiles.add(playbook3);
          sensor.registerIssue("Bla bla");
          sensor.registerIssue(playbook1.toString() + ":Bla bla");
          sensor.registerIssue(playbook1.toString() + ":2: [EUNKNOWN] Bla bla");
          sensor.registerIssue(playbook1.toString() + ":3: [EAnyCheck1] An error");
          sensor.registerIssue(playbook1.toString() + ":4: [AnyCheck2] Another error");
          sensor.registerIssue(playbook1.toString() + ":5: [EAnyCheck2] Another error");
          sensor.registerIssue(playbook2.toString() + ":3: [EAnyCheck2] Another error");
          sensor.saveIssues(context);
  
          Collection<Issue> issues = context.allIssues();
          assertEquals(3, issues.size());
          assertTrue(issueExists(issues, ruleKey2, playbook1, 3, "An error"));
          assertTrue(issueExists(issues, ruleKey3, playbook1, 5, "Another error"));
          assertTrue(issueExists(issues, ruleKey3, playbook2, 3, "Another error"));
      }
test_case.class_method_signature: AbstractAnsibleSensorTest.testSaveIssues()
test_case.full_signature: @Test public void testSaveIssues()
test_case.identifier: testSaveIssues
test_case.invocations: getInputFile getInputFile getInputFile add add add registerIssue registerIssue toString registerIssue toString registerIssue toString registerIssue toString registerIssue toString registerIssue toString saveIssues allIssues assertEquals size assertTrue issueExists assertTrue issueExists assertTrue issueExists
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSaveIssues()
focal_class.declarator: LOGGER = Loggers.get(AbstractAnsibleSensor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Loggers.get(AbstractAnsibleSensor.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: fileSystem
focal_class.modifier: protected final
focal_class.original_string: protected final FileSystem fileSystem;
focal_class.type: FileSystem
focal_class.var_name: fileSystem
focal_class.declarator: mainFilesPredicate
focal_class.modifier: protected final
focal_class.original_string: protected final FilePredicate mainFilesPredicate;
focal_class.type: FilePredicate
focal_class.var_name: mainFilesPredicate
focal_class.declarator: allIssues = new HashMap<>()
focal_class.modifier: protected final
focal_class.original_string: protected final Map<URI, Set<String>> allIssues = new HashMap<>();
focal_class.type: Map<URI, Set<String>>
focal_class.var_name: allIssues
focal_class.declarator: scannedFiles = new HashSet<>()
focal_class.modifier: protected final
focal_class.original_string: protected final Set<InputFile> scannedFiles = new HashSet<>();
focal_class.type: Set<InputFile>
focal_class.var_name: scannedFiles
focal_class.file: sonar-ansible-api/src/main/java/com/github/sbaudoin/sonar/plugins/ansible/rules/AbstractAnsibleSensor.java
focal_class.identifier: AbstractAnsibleSensor
focal_class.interfaces: implements Sensor
focal_class.class_method_signature: AbstractAnsibleSensor.AbstractAnsibleSensor(FileSystem fileSystem)
focal_class.full_signature: protected  AbstractAnsibleSensor(FileSystem fileSystem)
focal_class.identifier: AbstractAnsibleSensor
focal_class.modifiers: protected
focal_class.parameters: (FileSystem fileSystem)
focal_class.signature:  AbstractAnsibleSensor(FileSystem fileSystem)
focal_class.class_method_signature: AbstractAnsibleSensor.executeWithAnsibleLint(SensorContext context, @Nullable List<String> extraAnsibleLintArgs)
focal_class.full_signature: protected void executeWithAnsibleLint(SensorContext context, @Nullable List<String> extraAnsibleLintArgs)
focal_class.identifier: executeWithAnsibleLint
focal_class.modifiers: protected
focal_class.parameters: (SensorContext context, @Nullable List<String> extraAnsibleLintArgs)
focal_class.return: void
focal_class.signature: void executeWithAnsibleLint(SensorContext context, @Nullable List<String> extraAnsibleLintArgs)
focal_class.class_method_signature: AbstractAnsibleSensor.getAnsibleLintPath(SensorContext context)
focal_class.full_signature: protected String getAnsibleLintPath(SensorContext context)
focal_class.identifier: getAnsibleLintPath
focal_class.modifiers: protected
focal_class.parameters: (SensorContext context)
focal_class.return: String
focal_class.signature: String getAnsibleLintPath(SensorContext context)
focal_class.class_method_signature: AbstractAnsibleSensor.getAnsibleLintConfPath(SensorContext context)
focal_class.full_signature: protected String getAnsibleLintConfPath(SensorContext context)
focal_class.identifier: getAnsibleLintConfPath
focal_class.modifiers: protected
focal_class.parameters: (SensorContext context)
focal_class.return: String
focal_class.signature: String getAnsibleLintConfPath(SensorContext context)
focal_class.class_method_signature: AbstractAnsibleSensor.executeCommand(List<String> command, List<String> stdOut, List<String> errOut)
focal_class.full_signature: protected int executeCommand(List<String> command, List<String> stdOut, List<String> errOut)
focal_class.identifier: executeCommand
focal_class.modifiers: protected
focal_class.parameters: (List<String> command, List<String> stdOut, List<String> errOut)
focal_class.return: int
focal_class.signature: int executeCommand(List<String> command, List<String> stdOut, List<String> errOut)
focal_class.class_method_signature: AbstractAnsibleSensor.registerIssue(String rawIssue)
focal_class.full_signature: protected boolean registerIssue(String rawIssue)
focal_class.identifier: registerIssue
focal_class.modifiers: protected
focal_class.parameters: (String rawIssue)
focal_class.return: boolean
focal_class.signature: boolean registerIssue(String rawIssue)
focal_class.class_method_signature: AbstractAnsibleSensor.saveIssues(SensorContext context)
focal_class.full_signature: protected void saveIssues(SensorContext context)
focal_class.identifier: saveIssues
focal_class.modifiers: protected
focal_class.parameters: (SensorContext context)
focal_class.return: void
focal_class.signature: void saveIssues(SensorContext context)
focal_class.class_method_signature: AbstractAnsibleSensor.saveIssue(SensorContext context, InputFile inputFile, int line, String ruleId, String message)
focal_class.full_signature: protected void saveIssue(SensorContext context, InputFile inputFile, int line, String ruleId, String message)
focal_class.identifier: saveIssue
focal_class.modifiers: protected
focal_class.parameters: (SensorContext context, InputFile inputFile, int line, String ruleId, String message)
focal_class.return: void
focal_class.signature: void saveIssue(SensorContext context, InputFile inputFile, int line, String ruleId, String message)
focal_class.class_method_signature: AbstractAnsibleSensor.getRuleKey(SensorContext context, String ruleId)
focal_class.full_signature: protected RuleKey getRuleKey(SensorContext context, String ruleId)
focal_class.identifier: getRuleKey
focal_class.modifiers: protected
focal_class.parameters: (SensorContext context, String ruleId)
focal_class.return: RuleKey
focal_class.signature: RuleKey getRuleKey(SensorContext context, String ruleId)
focal_method.body: protected void saveIssues(SensorContext context) {
          for (InputFile inputFile : scannedFiles) {
              LOGGER.debug("Saving issues for {}", inputFile.uri());
              Set<String> issues = allIssues.getOrDefault(inputFile.uri(), new HashSet<>());
              for (String issue : issues) {
                  // Saved issues must have been registered first, so we are sure there is an extra :
                  String[] tokens = issue.split(":", 2);
                  LOGGER.debug("  Saving issue: {}", issue);
                  String[] ruleTokens = tokens[1].trim().split("\\] ", 2);
                  saveIssue(context, inputFile, Integer.parseInt(tokens[0]), ruleTokens[0].replace("[E", ""), ruleTokens[1]);
              }
          }
      }
focal_method.class_method_signature: AbstractAnsibleSensor.saveIssues(SensorContext context)
focal_method.full_signature: protected void saveIssues(SensorContext context)
focal_method.identifier: saveIssues
focal_method.invocations: debug uri getOrDefault uri split debug split trim saveIssue parseInt replace
focal_method.modifiers: protected
focal_method.parameters: (SensorContext context)
focal_method.return: void
focal_method.signature: void saveIssues(SensorContext context)