Package org.intellij.sonar.sonarserver

Examples of org.intellij.sonar.sonarserver.SonarServer$Rules


    if (settings == null) return null;

    final String serverName = settings.getServerName();
    final Optional<SonarServerConfig> serverConfig = SonarServers.get(serverName);
    if (!serverConfig.isPresent()) return null;
    final SonarServer sonarServer = SonarServer.create(serverConfig.get());
    final Rule rule = sonarServer.getRule(issue.get().getRuleKey());

    // persist rule
    if (sonarRules.isPresent()) {
      final SonarRules sonarRulesState = sonarRules.get().getState();
      if (sonarRulesState!= null && !rule.isEmpty()) {
View Full Code Here


  }

  @Override
  public void run() {
    sonarConsole.info("Downloading issues");
    final SonarServer sonarServer = SonarServer.create(sonarServerConfig);
    for (String resourceKey : resourceKeys) {
      sonarConsole.info(resourceKey);
      ProgressManager.getInstance().getProgressIndicator().setText(resourceKey);
      final ImmutableList<Issue> issues = sonarServer.getAllIssuesFor(resourceKey);
      downloadedIssuesByResourceKey.put(resourceKey, issues);
    }
    onSuccess();
  }
View Full Code Here

//    testGetIssues();
    testGetRules();
  }

  private static void testGetIssues() {
    SonarServer sonarServer = SonarServer.create("https://sonar.corp.mobile.de/sonar");
    final String resourceKey = "de.mobile.dealer:dealer-admin";
//    final String resourceKey = "de.mobile:mobile-multimodule-pom";
    final Issues issues = sonarServer.getIssuesFor(resourceKey);
    System.out.println(issues.size() + " issues for " + resourceKey + " | total: " + issues.paging().total() +
    " pages: " + issues.paging().pages() + " max results reached: " + issues.maxResultsReached());
  }
View Full Code Here

    System.out.println(issues.size() + " issues for " + resourceKey + " | total: " + issues.paging().total() +
    " pages: " + issues.paging().pages() + " max results reached: " + issues.maxResultsReached());
  }

  private static void testGetProfile() {
    SonarServer sonarServer = SonarServer.create("https://sonar.corp.mobile.de/sonar");
    final Profile profile = sonarServer.getProfile("java", "mobile_relaxed");
    System.out.println("rules count: " + profile.getRules().size());
  }
View Full Code Here

    final Profile profile = sonarServer.getProfile("java", "mobile_relaxed");
    System.out.println("rules count: " + profile.getRules().size());
  }

  private static void testGetRules() {
    SonarServer sonarServer = SonarServer.create("https://sonar.corp.mobile.de/sonar");
    final List<Rule> rules = sonarServer.getRules("java");
    System.out.println("rules count: " + rules.size());
    // title, description, key,
//    new SonarRuleBean()
    // title
    // key
View Full Code Here

    // title
    // key
  }

  private static void testGetResourceWithProfile() {
    SonarServer sonarServer = SonarServer.create("https://sonar.corp.mobile.de/sonar");
    final Resource resourceWithProfile = sonarServer.getResourceWithProfile("de.mobile:mobile-parkings-job");
    System.out.println("language: " + resourceWithProfile.getLanguage());
    System.out.println("profile: " + resourceWithProfile.getMeasure("profile").getData());
  }
View Full Code Here

    @Override
    public void run() {
      final Optional<SonarServerConfig> sonarServerConfiguration = SonarServers.get(mySonarServerName);
      if (sonarServerConfiguration.isPresent()) {
        final SonarServer sonarServer = SonarServer.create(sonarServerConfiguration.get());
        try {
          myAllProjectsAndModules = sonarServer.getAllProjectsAndModules();
          SonarResourcesComponent.getInstance().sonarResourcesBySonarServerName.put(mySonarServerName, ImmutableList.copyOf(myAllProjectsAndModules));
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            @Override
            public void run() {
              myResourcesTable.setModelAndUpdateColumns(new ListTableModel<Resource>(new ColumnInfo[]{NAME_COLUMN, KEY_COLUMN}, myAllProjectsAndModules, 0));
View Full Code Here

    System.out.println("language: " + resourceWithProfile.getLanguage());
    System.out.println("profile: " + resourceWithProfile.getMeasure("profile").getData());
  }

  private static void testGetAllProjectsAndModulesBySonarService() {
    SonarServer sonarServer = SonarServer.create("https://sonar.corp.mobile.de/sonar");
    List<Resource> allProjectsWithModules = sonarServer.getAllProjectsAndModules();
    for (Resource projectOrModule : allProjectsWithModules) {
      if (projectOrModule.getQualifier().equals(Resource.QUALIFIER_PROJECT)) {
        System.out.println("##################################################");
        System.out.println(projectOrModule.getName() + " (" + projectOrModule.getKey() + ")");
      } else if (projectOrModule.getQualifier().equals(Resource.QUALIFIER_MODULE)) {
View Full Code Here

TOP

Related Classes of org.intellij.sonar.sonarserver.SonarServer$Rules

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.