Search Results

Search found 25 results on 1 pages for 'checkstyle'.

Page 1/1 | 1 

  • Checkstyle: cannot summarise issues per author ?

    - by David Michel
    Hi all, I'm trying to use checkstyle for a java project but I can't seem to get it working properly: While it apparently runs smoothly, the html report doesn't give any info per authors as it should, i.e. the authors table is empty. The thing is I don't know how checkstyle identify an author. Does it look at the java doc tag @author ? at the class level or at the method level ? The ant task I used is below: <taskdef resource="checkstyletask.properties" classpath="${libs.dir}/checkstyle-all-5.0.jar"/> <target name="checkstyle" description="Generates a report of code convention violations."> <mkdir dir="${checkstyle.dir}"/> <checkstyle config="${util.dir}/checkstyle/sun_checks.xml" failureProperty="checkstyle.failure" failOnViolation="false"> <formatter type="xml" tofile="${checkstyle.dir}/checkstyle_report.xml"/> <fileset dir="${src.dir}" includes="**/*.java"/> </checkstyle> <xslt in="${checkstyle.dir}/checkstyle_report.xml" out="${checkstyle.dir}/checkstyle_report.html" style="${util.dir}/checkstyle/checkstyle-author.xsl"/> </target> Many thanks for your help David

    Read the article

  • Maven 2 checkstyle plugin version 2.5 - Problem with configLocation

    - by Nils Schmidt
    Hi there, I am using checkstyle plugin in maven 2. I now want to switch my config file, from the default one to a) an online file, or b) a local file. I tried the following two things, which both didnt work. Any suggestions? A) Local file, which is directly in my project folder next to the pom.xml <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <configuration> <configLocation>checkstyle.xml</configLocation> </configuration> </plugin> B) Remote file, that is stored on a server <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <configuration> <configLocation>http://stud.hs-heilbronn.de/~nischmid/development/checkstyle-config.xml</configLocation> </configuration> </plugin> Both cases result in an error like this: [INFO] An error has occurred in Checkstyle report generation. Embedded error: Failed during checkstyle execution Could not find resource 'file:checkstyle.xml'. Any help would be appreciated!

    Read the article

  • Checkstyle not working

    - by user330060
    Hi, I am new to maven and chekstyle, so need to ask some question... I want to use checkstyle in my maven based project, so in my pom.xml I have add the dependency <dependency> <groupId>checkstyle</groupId> <artifactId>checkstyle</artifactId> <version>2.4</version> </dependency> and also I have added the entry in plugin tag: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.4</version> <configuration> <enableRulesSummary>true</enableRulesSummary> <configLocation>checkstyle.xml</configLocation> </configuration> </plugin> But when I run my maven build with command mvn clean install, checkstyle doesn't do anything. And as I dont have any checkstyle.xml in my system yet, shouldn't it complains me about the error? What else configuration am I missing?

    Read the article

  • Allow single-line accessor (getter/setter) syntax with Checkstyle

    - by Sam3
    We'd like to have trivial Java property accessors using a single line syntax, so they take up much much less space, and are more readable (in terms of 'seeing' the set of accessors quickly). But we do want to enforce multi-line method syntax for everything else in our checkstyle configuration. But I'm not sure how to make this exception for accessors in Checkstyle config and suspect it may not be possible. So we'd like our accessors to look something like this: public String getFoo() { return foo; } public void setFoo(String foo) { this.foo = foo; } [In fact we'd rather not have trivial accessors at all and instead just annotate the private member variables with @Property or something and have the accessors generated for us, since writing endless get and set code delivers no real benefit, but that's a general Java frustration and an aside as far as this question goes.]

    Read the article

  • Checkstyle for C#?

    - by PSU_Kardi
    I'm looking to find something along the lines of Checkstyle for Visual Studio. I've recently started a new gig doing .NET work and realized that coding standards here are a bit lacking. While I'm still a young guy and far from the most experienced developer I'm trying to lead by example and get things going in the right direction. I loved the ability to use Checkstyle with Eclipse and examine code before reviews so I'd like to do the same thing with Visual Studio. Anyone have any good suggestions? Another thing I'd be somewhat interested in is a plug-in for SVN that disallows check-in until the main coding standards are met. I do not want people checking in busted code that's going to wind up in a code review. Any suggestions at this point would be great.

    Read the article

  • Does any body see a reson in DesignForExtension Check in Checkstyle?

    - by Roman Ivanov
    Check: http://checkstyle.sourceforge.net/config_design.html#DesignForExtension False positives: Checkstyle "Method Not Designed For Extension" error being incorrectly issued? checkstyle Method is not designed for extension - needs to be abstract, final or empty https://sourceforge.net/p/checkstyle/bugs/688/ Look like all switch that Check off in their configurations. Does anybody could show real code example where this Check is useful ? and good for developers.

    Read the article

  • Avoiding CheckStyle magic number errors in JDBC queries.

    - by Dan
    Hello, I am working on a group project for class and we are trying out CheckStyle. I am fairly comfortable with Java but have never touched JDBC or done any database work before this. I was wondering if there is an elegant way to avoid magic number errors in preparedStatement calls, consider: preparedStatement = connect.prepareStatement("INSERT INTO shows " + "(showid, showtitle, showinfo, genre, youtube)" + "values (default, ?, ?, ?, ?);"); preparedStatement.setString(1, title); preparedStatement.setString(2, info); preparedStatement.setString(3, genre); preparedStatement.setString(4, youtube); result = preparedStatement.executeUpdate(); The setString methods get flagged as magic numbers, so far I just added the numbers 3-10 or so to the ignore list for magic numbers but I was wondering if there was a better way to go about inserting those values into the statement. I also beg you for any other advice that comes to mind seeing that code, I'd like to avoid developing any nasty habits, e.g. should I be using Statement or is PreparedStatement fine? Will that let me refer to column names instead? Is that ideal? etc... Thanks!

    Read the article

  • Set plugin’s version on the command line in maven 2

    - by larry cai
    I generate default quickstart maven example, and type mvn checkstyle:checkstyle, it always try to use the lastest SNAPSHOT version, probably it is wrong in my nexus server, but How can I set plugin's version on the command line in maven2, like 2.5 for checkstyle instead of 2.6-SNAPSHOT C:\HelloWorld>mvn checkstyle:checkstyle [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'checkstyle'. [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Error building POM (may not be this project's POM). Project ID: org.apache.maven.plugins:maven-checkstyle-plugin Reason: Error getting POM for 'org.apache.maven.plugins:maven-checkstyle-plugin' from the repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata. org.apache.maven.plugins:maven-checkstyle-plugin:pom:2.6-SNAPSHOT from the specified remote repositories: nexus (http://localhost:9081/nexus/content/groups/public) for project org.apache.maven.plugins:maven-checkstyle-plugin I guess it could be "mvn checkstyle:2.5:checkstyle", unfortunately it is not. Surely if I set build dependance in pom.xml, it will work, but I want to see how command line can works

    Read the article

  • Checkstyle for Python

    - by oneself
    Is there an application similar to Java's Checkstyle for Python? By which I mean, I tool that analyzes Python code, and can be run as part of continuous integration (e.g. CruiseControl or Hudson). After analyzing it should produce an online accessible report which outlines any problems found in the code. Thank you,

    Read the article

  • Eclipse Plug-In Installation Issues

    - by Mudu
    Hi all I'm beginning to work with Eclipse for some Java development. I'm quite new to Eclipse, as I am a Visual Studio developer normally. I tried to install the CheckStyle Eclipse Plug-In and Subversive, using the Eclipse "Install new Software" feature. No errors, everything seems to have worked well. Clicking on "What software is already installed?" in the Install-dialogue shows me a list of installed plug-ins. Both Subversive and CheckStyle for Eclipse are listed. My only problem is that neither of them "work", that means I cannot see any new UI elements. According to the manual I have, I should see a new node "CheckStyle" in a project's properties. I haven't. I don't know exactly what Subversive looks like, but I'm sure there's a way to conveniently perform check-out operations etc. Manually copying the downloaded plug-in to the dropins-folder and restarting Eclipse subsequently does not help either. Is there a way to reliably find out whether there occurred any errors - I have no error message at all, what drives me crazy and makes the problem pretty difficult to describe/Google... Any help would be very cool! Cheers Matthias

    Read the article

  • Usage of static analysis tools - with Clear Case/Quest

    - by boyd4715
    We are in the process of defining our software development process and wanted to get some feed back from the group about this topic. Our team is spread out - US, Canada and India - and I would like to put into place some simple standard rules that all teams will apply to their code. We make use of Clear Case/Quest and RAD I have been looking at PMD, CPP, checkstyle and FindBugs as a start. My thought is to just put these into ANT and have the developers run these manually. I realize doing this you have to have some trust in that each developer will do this. The other thought is to add in some builders in to the IDE which would run a subset of the rules (keep the build process light) and then add another set (heavy) when they check in the code. Some other ideals is to make use of something like Cruse Control and have it set up to run these static analysis tools along with the unit test when ever Clear Case/Quest is idle. Wondering if others have done this and if it was successfully or can provide lessons learned.

    Read the article

  • Static code analysis for new language. Where to start?

    - by tinny
    I just been given a new assignment which looks like its going to be an interesting challenge. The customer is wanting a code style checking tool to be developed for their internal (soon to be open sourced) programming language which runs on the JVM. The language syntax is very Java like. The customer basically wants me to produce something like checkstyle. So my question is this, how would you approach this problem? Given a clean slate what recommendations would you make to the customer? I think I have 3 options Write something from scratch. Id prefer not to do this as it seems like this sort of code analysis tool problem has been solved so many times that there must be a more "framework" or "platform" orientated approach. Fork an existing code style checking tool and modify the parsing to fit with this new language etc etc Extend or plug into an existing static code analysis tool. (maybe write a plugin for Yasca?) Maybe you would like to share your experiences in this area? Thanks for reading

    Read the article

  • How to list TODO: in Ant build output

    - by C. Ross
    Related: How to use ant to check for tags (TODO: etc) in java source How can I get ant to list TODO: tags found in my code in the build output when I run it. I would like build failure to be optional (ie: a setting) if they are found. I've tried Checkstyle as suggested in the related post, but it doesn't display the text of the TODO:. IE: [checkstyle] .../src/Game.java:36: warning: Comment matches to-do format 'TODO:'. [checkstyle] .../src/Game.java:41: warning: Comment matches to-do format 'TODO:'. [checkstyle] .../src/GameThread.java:25: warning: Comment matches to-do format 'TODO:'. [checkstyle] .../src/GameThread.java:30: warning: Comment matches to-do format 'TODO:'. [checkstyle] .../src/GameThread.java:44: warning: Comment matches to-do format 'TODO:'.

    Read the article

  • Does Ivy's url resolver support transitive retrieval?

    - by Sean
    For some reason I can't seem to resolve the dependencies of my dependencies when using a url resolver to specify a repository's location. However, when using the ibiblio resolver, I am able to retrieve them. For example: <!-- Ivy File --> <ivy-module version="1.0"> <info organisation="org.apache" module="chained-resolvers"/> <dependencies> <dependency org="commons-lang" name="commons-lang" rev="2.0" conf="default"/> <dependency org="checkstyle" name="checkstyle" rev="5.0"/> </dependencies> </ivy-module> <!-- ivysettings file --> <ivysettings> <settings defaultResolver="chained"/> <resolvers> <chain name="chained"> <url name="custom-repo"> <ivy pattern="http://my.internal.domain.name/ivy/[organisation]/[module]/[revision]/ivy-[revision].xml"/> <artifact pattern="http://my.internal.domain.name/ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/> </url> <url name="ibiblio-mirror" m2compatible="true"> <artifact pattern="http://mirrors.ibiblio.org/pub/mirrors/maven2/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> </url> <ibiblio name="ibiblio" m2compatible="true"/> </chain> </resolvers> </ivysettings> <!-- checkstyle ivy.xml file generated from pom via ivy:install task --> <?xml version="1.0" encoding="UTF-8"?> <ivy-module version="1.0" xmlns:m="http://ant.apache.org/ivy/maven"> <info organisation="checkstyle" module="checkstyle" revision="5.0" status="release" publication="20090509202448" namespace="maven2" > <license name="GNU Lesser General Public License" url="http://www.gnu.org/licenses/lgpl.txt" /> <description homepage="http://checkstyle.sourceforge.net/"> Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard </description> </info> <configurations> <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/> <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/> <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/> <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/> <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/> <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/> <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/> <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/> <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/> <conf name="optional" visibility="public" description="contains all optional dependencies"/> </configurations> <publications> <artifact name="checkstyle" type="jar" ext="jar" conf="master"/> </publications> <dependencies> <dependency org="antlr" name="antlr" rev="2.7.6" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="apache" name="commons-beanutils-core" rev="1.7.0" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="apache" name="commons-cli" rev="1.0" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="apache" name="commons-logging" rev="1.0.3" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> <dependency org="com.google.collections" name="google-collections" rev="0.9" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/> </dependencies> </ivy-module> Using the "ibiblio" resolver I have no problem resolving my project's two dependencies (commons-lang 2.0 and checkstyle 5.0) and checkstyle's dependencies. However, when attempting to exclusively use the "custom-repo" or "ibiblio-mirror" resolvers, I am able to resolve my project's two explicitly defined dependencies, but not checkstyle's dependencies. Is this possible? Any help would be greatly appreciated.

    Read the article

  • How is technical debt best measured? What metric(s) are most useful?

    - by throp
    If I wanted to help a customer understand the degree of technical debt in his application, what would be the best metric to use? I've stumbled across Erik Doernenburg's code toxicity, and also Sonar's technical debt plugin, but was wondering what others exist. Ideally, I'd like to say "system A has a score of 100 whereas system B has a score of 50, so system A will most likely be more difficult to maintain than system B". Obviously, I understand that boiling down a complex concepts like "technical debt" or "maintainability" into a single number might be misleading or inaccurate (in some cases), however I need a simple way to convey the to a customer (who is not hands-on in the code) roughly how much technical debt is built into their system (relative to other systems), for the goal of building a case for refactoring/unit tests/etc. Again, I'm looking for one single number/graph/visualization, and not a comprehensive list of violations (e.g. CheckStyle, PMD, etc.).

    Read the article

  • How to name setter that does data conversion?

    - by IAdapter
    I'm struggling with how to name this method, I don't like the "set" prefix, because I feel it should be reserved for normal "dumb" setters and some tools might not like it (i did not check it in checkstyle, pmd, etc., but I got a feeling they won't like it.) for example (in java, but I feel its language agnostic) public void setActionListenerClicked(boolean actionListenerClicked) { this.actionListenerClicked = actionListenerClicked ? "1" : "0"; } The only purpose of this method is ONLY to set, this method is needed and cannot be joined with any other (because of framework used). P.S. I DO know that question is similar to How to name multi-setter?, but I feel its not the same question.

    Read the article

  • How to name multi-setter?

    - by IAdapter
    I'm struggling with how to name this method, I don't like the "set" prefix, because I feel it should be reserved for normal "dumb" setters and some tools might not like it (i did not check it in checkstyle, pmd, etc., but I got a feeling they won't like it.) for example (in java, but I feel its language agnostic) public void setField1Field2(String field1, String field2) { this.field1 = field1; this.field2 = field2; } The only purpose of this method is ONLY to set, this method is needed and cannot be joined with any other (because of framework used).

    Read the article

  • Best php qa tools

    - by Alexandre Victoor
    Hello, I am looking for qa tools for php. I am used to pmd, findbugs and checkstyle in the java world. Do you know some similar tools for php doing code analysis ? So far I have found but not tested yet : phplint pmd's cpd module PHP_CodeSniffer Thanks in advance for your help

    Read the article

  • Warning on missing custom javadoc tags

    - by flumins
    We create a custom Doclet for our projet to generate a specific documentation for our client. We define some specific tags that are parsed by the doclet when we generate the documentation. Do you know how to ask eclipse to add warning when those special tags are missing in our javadoc comments ? Example of well formed javadoc: /** * @dialogName TECK-01-E-608 * @useVO ServiceVO * @useVO AgentVO */ public class MyDialog extends BaseDialogImpl { ... If @dialogName is missing, the developper should have a warning in eclipse... I look checkstyle a little bit, but I don't understand how to configure it to do such a thing. Thanks in advance for your help.

    Read the article

  • Maven multi-module project with many reports: looking for an example

    - by hstoerr
    Is there an open source project that can serve as a good example on how to use the maven site plugin to generate reports? I would prefer it to consist of many modules, possibly hierarchically structured use as many plugins as possible (surefire, jxr, pmd, findbugs, javadoc, checkstyle, you name it) the reports should be aggregated: if some tests fail you want to have a single page that shows all modules with failing tests, not only a gazillion individual pages to check include enterprisey stuff (WAR, EAR etc), but this is not so important. The idea is to have something where you can gather ideas on how it is done and what is possible.

    Read the article

  • Visual Studio C++ Solution in Maven2

    - by graham.reeds
    A new project is coming up that will require interaction between Java and C++. It's been decided that the project will be built via Maven2. Unfortunately I don't know anything about Maven and the Java guys don't know anything about C++. They have their build chain all set up with various reports being emitted for each part related to CheckStyle, Findbugs, Corbortura(?) etc. and they want the same to be done with the C++ side. Currently we have 4 apps that need building: 2 services, a tray app and a simple dialog based application. I've been told I need to have a pom for each and configure each to output to a target directory, have the tool chain produce the reports - the most particular being the code coverage which the client wants 100%. I have sourced the tools - Bullseye and QA-C++ and requested eval copies - but I am dismayed to find there is very little information on C++ & Maven, and what little there is seems to be horror stories. Does anyone on SO have a good story about it (or have link to blog post)? Is there a simple explanation anywhere for configuring a Visual Studio solution (preferably C++) to be Mavenized? I am expecting pain but I am getting increasingly wary of this venture - but unfortunately the project manager is Java side and seems hell-bent on Mavenizing it.

    Read the article

  • Dealing With Java Default Level Access Specifiers

    - by Tom Tresansky
    I've seen some code in a project recently where some fields in a couple classes have been using the default access modifier without good reason to. It almost looks like a case of "oops, forgot to make these private". Since the classes are used almost exclusively outside of the package they are defined in, the fields are not visible from the calling code, and are treated as private. So the mistake/oversight would not be very noticeable. However, encapsulation is broken. If I wanted to add a new class to the existing package, I could then mess with internal data in objects using fields with default access. So, my questions: Are there any best practices concerning default access specifiers that I should be aware of? Anything that would help prevent this type of accident from re-occurring? Are are any annotations which might say something to the effect of "I really meant for these to be default access"? Using CheckStyle, or any other Eclipse plugins, is there any way to flag instances of default fields, or disallow any not accompanied by, say, a "//default access" comment trailing them?

    Read the article

1