<commit_before>/*
 * Copyright (C) 2015 <NAME>, se<EMAIL>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sebastian_daschner.jaxrs_analyzer.maven;

import com.sebastian_daschner.jaxrs_analyzer.JAXRSAnalyzer;
import com.sebastian_daschner.jaxrs_analyzer.LogProvider;
import com.sebastian_daschner.jaxrs_analyzer.backend.Backend;
import com.sebastian_daschner.jaxrs_analyzer.backend.swagger.SwaggerOptions;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static java.util.Collections.singleton;
import static java.util.stream.Collectors.joining;

/**
 * Maven goal which analyzes JAX-RS resources.
 *
 * @author <NAME>
 * @goal analyze-jaxrs
 * @phase process-classes
 * @requiresDependencyResolution compile
 */
public class JAXRSAnalyzerMojo extends AbstractMojo {

    /**
     * The chosen backend format. Defaults to plaintext.
     *
     * @parameter default-value="plaintext" property="jaxrs-analyzer.backend"
     */
    private String backend;

    /**
     * The domain where the project will be deployed.
     *
     * @parameter default-value="example.com" property="jaxrs-analyzer.deployedDomain"
     */
    private String deployedDomain;

    /**
     * The Swagger schemes.
     *
     * @parameter default-value="http" property="jaxrs-analyzer.swaggerSchemes"
     */
    private String[] swaggerSchemes;

    /**
     * Specifies if Swagger tags should be generated.
     *
     * @parameter default-value="false" property="jaxrs-analyzer.renderSwaggerTags"
     */
    private Boolean renderSwaggerTags;

    /**
     * The number at which path position the Swagger tags should be extracted.
     *
     * @parameter default-value="0" property="jaxrs-analyzer.swaggerTagsPathOffset"
     */
    private Integer swaggerTagsPathOffset;

    /**
     * @parameter property="project.build.outputDirectory"
     * @required
     * @readonly
     */
    private File outputDirectory;
<commit_msg>refs #25<commit_after>/*
 * Copyright (C) 2015 <NAME>, se<EMAIL>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sebastian_daschner.jaxrs_analyzer.maven;

import com.sebastian_daschner.jaxrs_analyzer.JAXRSAnalyzer;
import com.sebastian_daschner.jaxrs_analyzer.LogProvider;
import com.sebastian_daschner.jaxrs_analyzer.backend.Backend;
import com.sebastian_daschner.jaxrs_analyzer.backend.swagger.SwaggerOptions;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.resolution.ArtifactRequest;
import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult;

import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import static java.util.Collections.singleton;
import static java.util.stream.Collectors.joining;

/**
 * Maven goal which analyzes JAX-RS resources.
 *
 * @author <NAME>
 * @goal analyze-jaxrs
 * @phase process-classes
 * @requiresDependencyResolution compile
 */
public class JAXRSAnalyzerMojo extends AbstractMojo {

    /**
     * The chosen backend format. Defaults to plaintext.
     *
     * @parameter default-value="plaintext" property="jaxrs-analyzer.backend"
     */
    private String backend;

    /**
     * The domain where the project will be deployed.
     *
     * @parameter default-value="" property="jaxrs-analyzer.deployedDomain"
     */
    private String deployedDomain;

    /**
     * The Swagger schemes.
     *
     * @parameter default-value="http" property="jaxrs-analyzer.swaggerSchemes"
     */
    private String[] swaggerSchemes;

    /**
     * Specifies if Swagger tags should be generated.
     *
     * @parameter default-value="false" property="jaxrs-analyzer.renderSwaggerTags"
     */
    private Boolean renderSwaggerTags;

    /**
     * The number at which path position the Swagger tags should be extracted.
     *
     * @parameter default-value="0" property="jaxrs-analyzer.swaggerTagsPathOffset"
     */
    private Integer swaggerTagsPathOffset;

    /**
     * @parameter property="project.build.outputDirectory"
     * @required
     * @readonly
     */
    private File outputDirectory;

{'fraction_non_alphanumeric': 0.0965982028241335, 'fraction_numerical': 0.003209242618741977, 'mean_word_length': 3.9983961507618284, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4233569', 'n_tokens_mistral': 1833, 'n_tokens_neox': 1776, 'n_words': 455}