Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix sqale definitions #518

Merged
merged 1 commit into from
May 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cxx-checks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar-plugins.cxx</groupId>
<artifactId>cxx</artifactId>
<version>0.9.3-SNAPSHOT</version>
<version>0.9.4-SNAPSHOT</version>
</parent>

<artifactId>cxx-checks</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cxx-squid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar-plugins.cxx</groupId>
<artifactId>cxx</artifactId>
<version>0.9.3-SNAPSHOT</version>
<version>0.9.4-SNAPSHOT</version>
</parent>

<artifactId>cxx-squid</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>org.codehaus.sonar-plugins.cxx</groupId>
<artifactId>cxx</artifactId>
<version>0.9.3-SNAPSHOT</version>
<version>0.9.4-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Cxx</name>
Expand Down
2 changes: 1 addition & 1 deletion sonar-cxx-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.codehaus.sonar-plugins.cxx</groupId>
<artifactId>cxx</artifactId>
<version>0.9.3-SNAPSHOT</version>
<version>0.9.4-SNAPSHOT</version>
</parent>

<artifactId>sonar-cxx-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.sonar.api.server.rule.RulesDefinition;
import org.sonar.cxx.checks.CheckList;
import org.sonar.squidbridge.annotations.AnnotationBasedRulesDefinition;
import org.sonar.squidbridge.rules.SqaleXmlLoader;

public class CxxRuleRepository implements RulesDefinition {

Expand All @@ -37,6 +38,8 @@ public void define(Context context) {
//FIXME: set internal key to key to ensure rule templates works properly : should be removed when SONAR-6162 is fixed.
rule.setInternalKey(rule.key());
}

SqaleXmlLoader.load(repository, "/com/sonar/sqale/cxx-model.xml");
repository.done();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,25 @@
</chc>
<chc>
<rule-repo>cppcheck</rule-repo>
<rule-key>obsoleteFunctionsasctime_r</rule-key>
<rule-key>obsoleteFunctionsasctime</rule-key>
<prop>
<key>remediationFunction</key>
<txt>linear</txt>
</prop>
<prop>
<key>remediationFactor</key>
<val>5</val>
<txt>mn</txt>
</prop>
<prop>
<key>offset</key>
<val>0.0</val>
<txt>d</txt>
</prop>
</chc>
<chc>
<rule-repo>cppcheck</rule-repo>
<rule-key>obsoleteFunctionasctime</rule-key>
<prop>
<key>remediationFunction</key>
<txt>linear</txt>
Expand Down Expand Up @@ -8608,6 +8626,24 @@
<chc>
<key>ARCHITECTURE_RELIABILITY</key>
<name>Architecture related reliability</name>
<chc>
<rule-repo>cxx</rule-repo>
<rule-key>CycleBetweenPackages</rule-key>
<prop>
<key>remediationFunction</key>
<txt>linear</txt>
</prop>
<prop>
<key>remediationFactor</key>
<val>120</val>
<txt>mn</txt>
</prop>
<prop>
<key>offset</key>
<val>0.0</val>
<txt>d</txt>
</prop>
</chc>
</chc>
<chc>
<key>DATA_RELIABILITY</key>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Sonar C++ Plugin (Community)
* Copyright (C) 2010 Neticoa SAS France
* [email protected]
*
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
package org.sonar.plugins.cxx;

import static org.fest.assertions.Assertions.assertThat;
import org.junit.Test;
import org.sonar.api.server.rule.RulesDefinition;

public class CxxRuleRepositoryTest {

@Test
public void test() {
RulesDefinition.Context context = new RulesDefinition.Context();
assertThat(context.repositories()).isEmpty();

new CxxRuleRepository().define(context);

assertThat(context.repositories()).hasSize(1);
assertThat(context.repository("cxx").rules()).hasSize(40);
}
}
2 changes: 1 addition & 1 deletion sslr-cxx-toolkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.codehaus.sonar-plugins.cxx</groupId>
<artifactId>cxx</artifactId>
<version>0.9.3-SNAPSHOT</version>
<version>0.9.4-SNAPSHOT</version>
</parent>

<artifactId>sslr-cxx-toolkit</artifactId>
Expand Down