BufferedReviewRequest.java


Package: org.hammurapi

Results
Date2007/07/27
Codebase378
Reviews682
DPMO219
Sigma5.015

Metrics
NameNumberMinAvgMaxTotal
Class complexity14.004.004.004.00
Code length31.004.3311.0013.00
File length166.0066.0066.0066.00
Operation complexity31.001.332.004.00
Work order179.7479.7479.7479.74

Violations
#LineColumnNameSeverityDescription
1231ER-0233Packages should begin with []
244106ER-0363Line is too long
3361ER-0492Unify logging strategy - define individual logger for class
44837ER-0293Avoid hardwired numeric literals
5589ER-1053Document all Interfaces and public methods. Use a Class header. Provide Javadoc
6629ER-1053Document all Interfaces and public methods. Use a Class header. Provide Javadoc

JavaDoc
BufferedReviewRequest

1/*
2 * Hammurapi
3 * Automated Java code review system.
4 * Copyright (C) 2004 Hammurapi Group
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 * URL: http://www.hammurapi.org
21 * e-Mail: support@hammurapi.biz
22 */

23package org.hammurapi;
24
25import java.io.IOException;
26import java.io.Reader;
27import java.io.StringReader;
28import java.io.StringWriter;
29
30/**
31 * Buffers source stream.
32 * @author Pavel Vlasov
33 *
34 * @version $Revision: 1.2 $
35 */

36public abstract class BufferedReviewRequest extends ReviewRequestBase {
37 private String source;
38 private String name;
39
40 /**
41 * Reads input into buffer.
42 * @throws IOException
43 */

44 public BufferedReviewRequest(ClassLoader classLoader, Reader in, String name) throws IOException {
45 super(classLoader);
46 this.name=name;
47 StringWriter sw=new StringWriter();
48 char[] buf=new char[4096];
49 int l;
50 while ((l=in.read(buf))!=-1) {
51 sw.write(buf, 0, l);
52 }
53 in.close();
54 sw.close();
55 source=sw.toString();
56 }
57
58 public Reader getSource() {
59 return new StringReader(source);
60 }
61
62 public String getName() {
63 return name;
64 }
65}
66
67

Hammurapi 3 Copyright © 2004 Hammurapi Group. All Rights Reserved.