All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qualinsight.plugins.sonarqube.smell.api.annotation.Smell Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
/*
 * qualinsight-plugins-sonarqube-smell
 * Copyright (c) 2015, QualInsight
 * http://www.qualinsight.com/
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program. If not, you can retrieve a copy
 * from .
 */
package com.qualinsight.plugins.sonarqube.smell.api.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.qualinsight.plugins.sonarqube.smell.api.model.SmellType;

/**
 * Source retention annotation that can be used to report a Code Smell, i.e. a code smell that needs to be reported in SonarQube.
 *
 * @author Michel Pawlak
 */
@Retention(RetentionPolicy.SOURCE)
@Target({
    ElementType.PACKAGE,
    ElementType.TYPE,
    ElementType.METHOD,
    ElementType.CONSTRUCTOR,
    ElementType.FIELD,
    ElementType.PARAMETER,
    ElementType.LOCAL_VARIABLE
})
public @interface Smell {

    /**
     * Evaluation of the time in minutes that would be needed to remove the code smell.
     *
     * @return time in minutes that would be needed to remove the code smell.
     */
    public int minutes();

    /**
     * Provides the reason why the developer marked the code as being a code smell.
     *
     * @return the reason that led to reporting the code smell.
     */
    public String reason();

    /**
     * Indicates the category the code smell belongs to.
     *
     * @return the Smell category the code smell is member of
     */
    public SmellType type();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy