Package com.buschmais.jqassistant.core.analysis.api.rule

Examples of com.buschmais.jqassistant.core.analysis.api.rule.RuleSet


  @Override
  public void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException,
      MojoFailureException {
    getLog().info("Effective rules for '" + baseProject.getName() + "'.");
    RuleSet targetRuleSet = resolveEffectiveRules(baseProject);
    logRuleSet(targetRuleSet);
  }
View Full Code Here


    protected boolean failOnConstraintViolations;

    @Override
    public void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException, MojoFailureException {
        getLog().info("Executing analysis for '" + baseProject.getName() + "'.");
        final RuleSet ruleSet = resolveEffectiveRules(baseProject);
        InMemoryReportWriter inMemoryReportWriter = new InMemoryReportWriter();
        FileWriter xmlReportFileWriter;
        try {
            xmlReportFileWriter = new FileWriter(getXmlReportFile(baseProject));
        } catch (IOException e) {
View Full Code Here

   * @return The resolved rules set.
   * @throws MojoExecutionException
   *             If resolving fails.
   */
  protected RuleSet resolveEffectiveRules(MavenProject baseProject) throws MojoExecutionException {
    RuleSet ruleSet = readRules(baseProject);
    validateRuleSet(ruleSet);
    try {
      return ruleSelector.getEffectiveRuleSet(ruleSet, concepts, constraints, groups);
    } catch (RuleSetResolverException e) {
      throw new MojoExecutionException("Cannot resolve rules.", e);
View Full Code Here

  @Override
  public void aggregate(MavenProject baseProject, Set<MavenProject> projects, Store store) throws MojoExecutionException,
      MojoFailureException {
    getLog().info("Available rules for '" + baseProject.getName() + "'.");
    RuleSet ruleSet = readRules(baseProject);
    logRuleSet(ruleSet);
  }
View Full Code Here

    }

    @Override
    protected void doTheTask(final Store store) {
        getLog().info("Executing analysis.");
        final RuleSet ruleSet = resolveEffectiveRules();
        InMemoryReportWriter inMemoryReportWriter = new InMemoryReportWriter();
        FileWriter xmlReportFileWriter;
        try {
            xmlReportFileWriter = new FileWriter(getXmlReportFile());
        } catch (IOException e) {
View Full Code Here

        }
    }

    // copied from AbstractAnalysisMojo
    protected RuleSet resolveEffectiveRules() {
        RuleSet ruleSet = readRules();
        validateRuleSet(ruleSet);
        try {
            return ruleSelector.getEffectiveRuleSet(ruleSet, concepts, constraints, groups);
        } catch (RuleSetResolverException e) {
            throw new RuntimeException("Cannot resolve rules.", e);
View Full Code Here

                ;
            else {
                throw new IllegalArgumentException("Illegal argument " + argument);
            }
        }
        RuleSet availableRules = getAvailableRules();
        RuleSelector ruleSelector = new RuleSelectorImpl();
        return ruleSelector.getEffectiveRuleSet(availableRules, conceptNames, constraintNames, groupNames);
    }
View Full Code Here

        return "analyze";
    }

    @Override
    public Continuation execute(AppCommandParser parser, Session session, final Output out) throws Exception {
        RuleSet effectiveRuleSet = getEffectiveRuleSet(parser);
        InMemoryReportWriter reportWriter = new InMemoryReportWriter();
        Store store = getStore();
        store.start(getScannerPluginRepository().getDescriptorTypes());
        ShellConsole console = new ShellConsole(out);
        Analyzer analyzer = new AnalyzerImpl(store, reportWriter, console);
View Full Code Here

        } catch (PluginRepositoryException e) {
            throw new SonarException("Cannot read rules.", e);
        }
        List<Source> ruleSources = rulePluginRepository.getRuleSources();
        RuleSetReader ruleSetReader = new RuleSetReaderImpl();
        RuleSet ruleSet = ruleSetReader.read(ruleSources);
        for (Concept concept : ruleSet.getConcepts().values()) {
            rules.add(createRule(concept, RuleType.Concept));
        }
        for (Constraint constraint : ruleSet.getConstraints().values()) {
            rules.add(createRule(constraint, RuleType.Constraint));
        }
        rules.addAll(annotationRuleParser.parse(JQAssistant.KEY, RULE_CLASSES));
        return rules;
    }
View Full Code Here

            throw new IllegalStateException("Cannot get scanner plugin repository", e);
        }
    }

    protected RuleSet getEffectiveRuleSet(List<String> conceptNames, List<String> constraintNames, List<String> groupNames) throws RuleSetResolverException {
        RuleSet availableRules = getAvailableRules();
        RuleSelector ruleSelector = new RuleSelectorImpl();
        return ruleSelector.getEffectiveRuleSet(availableRules, conceptNames, constraintNames, groupNames);
    }
View Full Code Here

TOP

Related Classes of com.buschmais.jqassistant.core.analysis.api.rule.RuleSet

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.