ambition/tmp/metric_fu/output/586fb7c4e1add2d4d24e27566ed...

649 lines
16 KiB
HTML

<html>
<head>
<style>
table { background: #fff; color: #000; }
.ruby .normal { color: #000; }
.ruby .comment { color: #005; font-style: italic; }
.ruby .keyword { color: #A44; font-weight: bold; }
.ruby .method { color: #44f; }
.ruby .class { color: #b1713d; }
.ruby .module { color: #050; }
.ruby .punct { color: #668; font-weight: bold; }
.ruby .symbol { color: #00f; }
.ruby .string { color: #4a4; }
.ruby .char { color: #F07; }
.ruby .ident { color: #000; }
.ruby .constant { color: #b1713d; }
.ruby .regex { color: #B66; background: #FEF; }
.ruby .number { color: #F99; }
.ruby .attribute { color: #f84; }
.ruby .global { color: #7FB; }
.ruby .expr { color: #227; }
.ruby .escape { color: #277; }
</style>
<title>Analyzed File Report</title>
</head>
<body>
<table cellpadding='0' cellspacing='0' class='ruby'>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n1" name="n1">1</a></span><span class="keyword">class</span> <span class="class">NotesController</span> &lt; <span class="constant">ApplicationController</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n2" name="n2">2</a></span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n3" name="n3">3</a></span> before_action <span class="symbol">:authenticate</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n4" name="n4">4</a></span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n5" name="n5">5</a></span> <span class="comment">#</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n6" name="n6">6</a></span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
<ul>
<li>Complexity 4 &raquo; saikuro</li>
<li>Method "getNotesList" has 24 lines. It should have 20 or less. &raquo; roodi</li>
<li>Method name "getNotesList" should match pattern /^[_a-z<>=\[\]|+-\/\*`]+[_a-z0-9_<>=~@\[\]]*[=!\?]?$/ &raquo; roodi</li>
<li>DuplicateMethodCall - calls n.created_at 2 times &raquo; reek</li>
<li>DuplicateMethodCall - calls n.created_at.to_s 2 times &raquo; reek</li>
<li>TooManyStatements - has approx 13 statements &raquo; reek</li>
<li>UncommunicativeMethodName - has the name 'getNotesList' &raquo; reek</li>
<li>UncommunicativeVariableName - has the variable name 'h' &raquo; reek</li>
<li>UncommunicativeVariableName - has the variable name 'k' &raquo; reek</li>
<li>UncommunicativeVariableName - has the variable name 'n' &raquo; reek</li>
<li>UncommunicativeVariableName - has the variable name 'v' &raquo; reek</li>
<li>FeatureEnvy - refers to n more than self &raquo; reek</li>
</ul>
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n7" name="n7">7</a></span> <span class="keyword">def</span> <span class="function">getNotesList</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n8" name="n8">8</a></span> <span class="comment">#Todo</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"> <a href="#n9" name="n9">9</a></span> pid = params[<span class="symbol">:project_id</span>]
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><strong><a href="#n10" name="n10">10</a></strong></span> uid = session[<span class="symbol">:user_id</span>]
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n11" name="n11">11</a></span> notes = <span class="constant">Note</span>.where(<span class="string"><span class="delimiter">&quot;</span><span class="content">user_id = ? AND project_id = ? </span><span class="delimiter">&quot;</span></span>,uid,pid).order(<span class="string"><span class="delimiter">&quot;</span><span class="content">created_at desc</span><span class="delimiter">&quot;</span></span>).all
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n12" name="n12">12</a></span> note = <span class="constant">Hash</span>.new <span class="keyword">do</span> |h,k|
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n13" name="n13">13</a></span> h[k] = []
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n14" name="n14">14</a></span> <span class="keyword">end</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n15" name="n15">15</a></span> notes.each <span class="keyword">do</span> |n|
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n16" name="n16">16</a></span> date = n.created_at.to_s[<span class="regexp"><span class="delimiter">/</span><span class="content">([</span><span class="char">\d</span><span class="char">\-</span><span class="content">]*)</span><span class="char">\s</span><span class="content">(.*)</span><span class="delimiter">/</span></span>,<span class="integer">1</span>]
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n17" name="n17">17</a></span> time = n.created_at.to_s[<span class="regexp"><span class="delimiter">/</span><span class="content">(.*)</span><span class="char">\s</span><span class="content">([</span><span class="char">\d</span><span class="char">\:</span><span class="content">]*)</span><span class="delimiter">/</span></span>,<span class="integer">2</span>]
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n18" name="n18">18</a></span> note[date] &lt;&lt; {
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n19" name="n19">19</a></span> <span class="symbol">:content</span> =&gt; n.content,
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><strong><a href="#n20" name="n20">20</a></strong></span> <span class="symbol">:time</span> =&gt; time,
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n21" name="n21">21</a></span> <span class="symbol">:type</span> =&gt; n.category
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n22" name="n22">22</a></span> }
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n23" name="n23">23</a></span> <span class="keyword">end</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n24" name="n24">24</a></span> data = []
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n25" name="n25">25</a></span> note.each <span class="keyword">do</span> |k,v|
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n26" name="n26">26</a></span> data += [{
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n27" name="n27">27</a></span> <span class="symbol">:time</span> =&gt; k,
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n28" name="n28">28</a></span> <span class="symbol">:notes</span> =&gt; v
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n29" name="n29">29</a></span> }]
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><strong><a href="#n30" name="n30">30</a></strong></span> <span class="keyword">end</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n31" name="n31">31</a></span> render <span class="symbol">:json</span> =&gt; {
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n32" name="n32">32</a></span> <span class="symbol">:code</span> =&gt; <span class="integer">0</span>,
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n33" name="n33">33</a></span> <span class="symbol">:data</span> =&gt; data
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n34" name="n34">34</a></span> }
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n35" name="n35">35</a></span> <span class="keyword">end</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n36" name="n36">36</a></span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
&nbsp;
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n37" name="n37">37</a></span><span class="keyword">end</span></pre></div>
</div>
</td>
</tr>
</table>
</body>
</html>