<dataset>
- <rules_categories id="1" name="Efficiency" description="Efficiency"/>
- <rules_categories id="6" name="Usability" description="Usability"/>
-
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="Efficiency" description="Efficiency"/>
- <rules_categories id="6" name="Usability" description="Usability"/>
-
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="Efficiency" description="Efficiency"/>
- <rules_categories id="6" name="Usability" description="Usability"/>
-
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
enabled="true" worst_value="0" optimized_best_value="true" best_value="100" direction="1" hidden="false"/>
- <rules_categories id="1" name="Efficiency" description="Efficiency"/>
- <rules_categories id="6" name="Usability" description="Usability"/>
-
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="category one" description="One"/>
<rules id="1" name="foo" plugin_config_key="checker/foo" plugin_rule_key="checkstyle.rule1"
plugin_name="maven-checkstyle-plugin" description="description" cardinality="SINGLE" parent_id="[null]"/>
<class>org.sonar.api.security.GroupRole</class>
<class>org.sonar.api.rules.Rule</class>
<class>org.sonar.api.rules.RuleParam</class>
- <class>org.sonar.api.rules.RulesCategory</class>
<class>org.sonar.api.resources.ProjectLink</class>
<class>org.sonar.api.profiles.RulesProfile</class>
<class>org.sonar.api.rules.ActiveRule</class>
<dataset>
- <rules_categories id="6" name="Efficiency" description="Efficiency" />
-
<!-- CHECKSTYLE -->
<rules id="1" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
<dataset>
- <rules_categories id="6" name="Efficiency" description="Efficiency" />
-
<!-- CHECKSTYLE -->
<rules id="1" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
- <rules_categories id="2" name="category two" description="two"/>
-
<rules id="1" name="rule one" description="desc" plugin_config_key="config"
plugin_rule_key="rule_one" plugin_name="plugin1" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
-
<rules id="1" name="rule1" description="desc" plugin_config_key="config"
plugin_rule_key="key1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
-
<rules id="1" name="rule1" description="desc" plugin_config_key="config"
plugin_rule_key="key1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
-
<rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
<rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
-
<rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
<rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
-
<rules_profiles id="1" provided="true" name="profile one" default_profile="1" language="java" enabled="true"/>
<rules_profiles id="2" provided="true" name="profile two" default_profile="0" language="java" enabled="true"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
-
<!-- Rules -->
<rules id="1" name="new1" description="test1" plugin_config_key="checker/new1"
plugin_rule_key="checkstyle.new1" plugin_name="PLUGIN_KEY" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
-
<rules id="1" name="foo" description="test" plugin_config_key="checker/foo"
plugin_rule_key="checkstyle.rule1" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="category one" description="one"/>
-
<rules id="1" name="rule one" description="desc" plugin_config_key="other config"
plugin_rule_key="rule_one" plugin_name="plugin" enabled="true" cardinality="SINGLE" parent_id="[null]"/>
<rules id="2" name="rule two" description="desc" plugin_config_key="config"
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules.xml;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
-import com.thoughtworks.xstream.annotations.XStreamImplicit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @deprecated since 2.3
- */
-@Deprecated
-@XStreamAlias("profile")
-public class Profile {
-
- @XStreamAsAttribute
- private String language;
-
- @XStreamAsAttribute
- private String name;
-
- @XStreamImplicit
- private List<Rule> rules = new ArrayList<Rule>();
-
- public List<Rule> getRules() {
- return rules;
- }
-
- public void setRules(List<Rule> rules) {
- this.rules = rules;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getLanguage() {
- return language;
- }
-
- public void setLanguage(String language) {
- this.language = language;
- }
-}
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules.xml;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
-
-/**
- * @deprecated since 2.3
- */
-@Deprecated
-@XStreamAlias("property")
-public class Property {
-
- @XStreamAsAttribute
- private String name;
-
- @XStreamAsAttribute
- private String value;
-
- public Property(String name, String value) {
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public String getValue() {
- return value;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules.xml;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
-import com.thoughtworks.xstream.annotations.XStreamImplicit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @deprecated since 2.3
- */
-@Deprecated
-@XStreamAlias("rule")
-public class Rule implements Comparable<String> {
-
- @XStreamAsAttribute
- private String key;
-
- @XStreamAsAttribute
- private String priority;
-
- @XStreamImplicit
- private List<Property> properties;
-
- public Rule(String ref) {
- this(ref, null);
- }
-
- public Rule(String ref, String priority) {
- this.key = ref;
- this.priority = priority;
- }
-
- public String getKey() {
- return key;
- }
-
- public void setProperties(List<Property> properties) {
- this.properties = properties;
- }
-
- public List<Property> getProperties() {
- return properties;
- }
-
- public int compareTo(String o) {
- return o.compareTo(key);
- }
-
- public String getPriority() {
- return priority;
- }
-
- public void setPriority(String priority) {
- this.priority = priority;
- }
-
- public void addProperty(Property property) {
- if (properties == null) {
- properties = new ArrayList<Property>();
- }
- properties.add(property);
- }
-
-}
\ No newline at end of file
String PROP_EMBEDDED_PORT = "sonar.embeddedDatabase.port";
String PROP_HIBERNATE_DEFAULT_SCHEMA = "sonar.hibernate.default_schema";
-
String PROP_EMBEDDED_DATA_DIR = "sonar.embeddedDatabase.dataDir";
String DIALECT_DERBY = "derby";
-
- /**
- * @deprecated not supported anymore since v.2.13.
- */
- @Deprecated
- String DIALECT_HSQLDB = "hsqldb";
String DIALECT_MYSQL = "mysql";
String DIALECT_POSTGRESQL = "postgresql";
String DIALECT_ORACLE = "oracle";
String DIALECT_DB2 = "db2";
-
String DIALECT_MSSQL = "mssql";
}
\ No newline at end of file
return this;
}
- /**
- * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
- */
- @Deprecated
- public Integer getRulesCategoryId() {
- return null;
- }
-
- /**
- * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
- */
- @Deprecated
- public MeasureModel setRulesCategoryId(Integer id) {
- return this;
- }
-
/**
* @return the rule priority
*/
return StringUtils.abbreviate(StringUtils.trim(message), MESSAGE_COLUMN_SIZE);
}
- /**
- * @deprecated since 2.7. Replace by getPriority()
- */
- @Deprecated
- public RulePriority getLevel() {
- return priority;
- }
-
- /**
- * @deprecated since 2.7. Replace by setPriority()
- */
- @Deprecated
- public void setLevel(RulePriority priority) {
- this.priority = priority;
- }
-
public Integer getRuleId() {
return ruleId;
}
+++ /dev/null
-/*
- * Sonar, open source software quality management tool.
- * Copyright (C) 2008-2012 SonarSource
- * mailto:contact AT sonarsource DOT com
- *
- * Sonar 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.
- *
- * Sonar 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 Sonar; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
- */
-package org.sonar.api.rules;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @deprecated since 2.5. See http://jira.codehaus.org/browse/SONAR-2007
- */
-@Deprecated
-public final class Iso9126RulesCategories {
- private Iso9126RulesCategories() {
- }
-
- public static final RulesCategory RELIABILITY = new RulesCategory("Reliability",
- "The extent to which the project can be expected to perform its intended function with rescission." +
- " Some examples : are loop indexes range tested? Is input data checked for range errors ? Is divide-by-zero avoided ? Is exception handling provided ?");
- public static final RulesCategory EFFICIENCY = new RulesCategory("Efficiency",
- "The extent to which the project fulfills its purpose without waste of resources." +
- " This means resources in the sense of memory utilisation and processor speed.");
- public static final RulesCategory PORTABILITY = new RulesCategory("Portability",
- "The extent to which the project can be operated easily and well on multiple computer configurations." +
- " Portability can mean both between different hardware setups and between different operating systems -- such as running on both Mac OS X and GNU/Linux.");
- public static final RulesCategory USABILITY = new RulesCategory("Usability",
- "The extent to which the project can be understood, learned, operated, attractive and compliant with usability regulations and guidelines." +
- " It commonly relies on naming conventions and formatting rules.");
- public static final RulesCategory MAINTAINABILITY = new RulesCategory("Maintainability",
- "The extent to which the project facilitates updating to satisfy new requirements. Thus the the project which is maintainable should be not complex.");
-
- public static final List<RulesCategory> ALL = Collections.unmodifiableList(Arrays.asList(RELIABILITY, EFFICIENCY, PORTABILITY, USABILITY, MAINTAINABILITY));
-}
@Table(name = "rules")
public final class Rule {
- private static final RulesCategory NONE = new RulesCategory("none");
-
@Id
@Column(name = "id")
@GeneratedValue
return this;
}
- /**
- * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
- */
- @Deprecated
- public RulesCategory getRulesCategory() {
- return NONE;
- }
-
- /**
- * @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
- */
- @Deprecated
- public Rule setRulesCategory(RulesCategory rulesCategory) {
- return this;
- }
-
/**
* @deprecated since 2.5 use {@link #getRepositoryKey()} instead
*/
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Immutable;
import org.sonar.api.database.BaseIdentifiable;
-import org.sonar.check.IsoCategory;
import javax.persistence.Column;
import javax.persistence.Entity;
* @deprecated since 2.5 See http://jira.codehaus.org/browse/SONAR-2007
*/
@Deprecated
-@Immutable
-@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
-@Entity
-@Table(name = "rules_categories")
public class RulesCategory extends BaseIdentifiable {
- @Column(name = "name", updatable = false, nullable = false)
private String name;
-
- @Column(name = "description", updatable = false, nullable = true)
private String description;
/**
}
RulesCategory other = (RulesCategory) obj;
return new EqualsBuilder()
- .append(name, other.getName()).isEquals();
+ .append(name, other.getName()).isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
- .append(name)
- .toHashCode();
+ .append(name)
+ .toHashCode();
}
@Override
public String toString() {
return new ToStringBuilder(this)
- .append("id", getId())
- .append("name", name)
- .append("desc", description)
- .toString();
- }
-
- public IsoCategory toIsoCategory() {
- if (name.equals(Iso9126RulesCategories.EFFICIENCY.getName())) {
- return IsoCategory.Efficiency;
- }
- if (name.equals(Iso9126RulesCategories.MAINTAINABILITY.getName())) {
- return IsoCategory.Maintainability;
- }
- if (name.equals(Iso9126RulesCategories.PORTABILITY.getName())) {
- return IsoCategory.Portability;
- }
- if (name.equals(Iso9126RulesCategories.RELIABILITY.getName())) {
- return IsoCategory.Reliability;
- }
- if (name.equals(Iso9126RulesCategories.USABILITY.getName())) {
- return IsoCategory.Usability;
- }
- return null;
- }
-
- public static RulesCategory fromIsoCategory(IsoCategory iso) {
- if (iso == IsoCategory.Efficiency) {
- return Iso9126RulesCategories.EFFICIENCY;
- }
- if (iso == IsoCategory.Maintainability) {
- return Iso9126RulesCategories.MAINTAINABILITY;
- }
- if (iso == IsoCategory.Portability) {
- return Iso9126RulesCategories.PORTABILITY;
- }
- if (iso == IsoCategory.Reliability) {
- return Iso9126RulesCategories.RELIABILITY;
- }
- if (iso == IsoCategory.Usability) {
- return Iso9126RulesCategories.USABILITY;
- }
- return null;
+ .append("id", getId())
+ .append("name", name)
+ .append("desc", description)
+ .toString();
}
}
public void shouldRemoveNewLineCharactersInNameWithfirstConstructor() {
Rule rule;
for (String example : getExamplesContainingNewLineCharacter()) {
- rule = new Rule(null, null, example, (RulesCategory) null, null);
+ rule = new Rule(null, null).setName(example);
assertThat(rule.getName(), is("test"));
}
}
public void shouldRemoveNewLineCharactersInNameWithSecondConstructor() {
Rule rule;
for (String example : getExamplesContainingNewLineCharacter()) {
- rule = new Rule(null, null, example, null, null);
+ rule = new Rule(null, null).setName(example);
assertThat(rule.getName(), is("test"));
}
}
rule = new Rule("name", "key");
assertThat(rule.getSeverity(), Is.is(RulePriority.MAJOR));
- rule = new Rule("pkey", "key", "name", Iso9126RulesCategories.EFFICIENCY, null, null);
- assertThat(rule.getSeverity(), Is.is(RulePriority.MAJOR));
-
rule.setSeverity(RulePriority.BLOCKER);
assertThat(rule.getSeverity(), Is.is(RulePriority.BLOCKER));
@measures_by_sid={}
unless @metrics.empty?
- sql_conditions = ['snapshots.project_id=:rid AND snapshots.status=:status AND project_measures.rules_category_id IS NULL AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL AND project_measures.person_id IS NULL']
+ sql_conditions = ['snapshots.project_id=:rid AND snapshots.status=:status AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL AND project_measures.person_id IS NULL']
sql_values = {:rid => @resource.id, :status => Snapshot::STATUS_PROCESSED}
if params[:fromDateTime]
t.column :rule_id, :integer
t.column :rules_category_id, :integer
t.column :text_value, :string, :limit => 96, :null => true
- t.column 'tendency', :integer, :null => true
+ t.column :tendency, :integer, :null => true
t.column :measure_date, :datetime, :null => true
t.column :project_id, :integer, :null => true
t.column :alert_status, :string, :limit => 5, :null => true
RulesProfile profileNotProvided = new RulesProfile("test not provided", "lang", false, false);
getSession().save(profileProvided, profileNotProvided);
- Rule rule1 = new Rule("testPlugin", "testKey", "testName", null, null);
- Rule rule2 = new Rule("testPlugin", "testKey2", "testName2", null, null);
+ Rule rule1 = new Rule("testPlugin", "testKey");
+ Rule rule2 = new Rule("testPlugin", "testKey2");
getSession().save(rule1, rule2);
RuleParam ruleParam1 = new RuleParam(rule1, "paramKey", "test", "int");
getSession().save(ruleParam1);
<dataset>
- <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-
<rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]" />
<dataset>
- <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-
<rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]"/>
<dataset>
- <rules_categories id="1" name="Efficiency" description="Efficiency"/>
-
<rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
enabled="true" priority="2" cardinality="SINGLE" parent_id="[null]"/>