ambition/reports/metric_fu/output/8072e824009715d8b89c1b35b6b...

511 lines
13 KiB
HTML
Raw Permalink Normal View History

2017-01-19 22:12:03 +08:00
<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'>
<ul>
<li>Class name "Projects_user" should match pattern /^[A-Z][a-zA-Z0-9]*$/ &raquo; roodi</li>
</ul>
</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">Projects_user</span> &lt; <span class="constant">ActiveRecord</span>:: <span class="constant">Base</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> validates <span class="symbol">:project_id</span>, <span class="key">presence</span>: <span class="predefined-constant">true</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> validates <span class="symbol">:user_id</span>, <span class="key">presence</span>: <span class="predefined-constant">true</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>
</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> validate <span class="symbol">:user_exists</span> , <span class="key">on</span>: <span class="symbol">:create</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="#n7" name="n7">7</a></span> validate <span class="symbol">:project_exists</span>, <span class="key">on</span>: <span class="symbol">:create</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>
</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> private
</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>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
<ul>
<li>Complexity 2 &raquo; saikuro</li>
<li>NilCheck - performs a nil-check &raquo; reek</li>
</ul>
</td>
<td valign='top'>
<div class="CodeRay">
<div class="code"><pre><span class="line-numbers"><a href="#n11" name="n11">11</a></span> <span class="keyword">def</span> <span class="function">project_exists</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="#n12" name="n12">12</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="#n13" name="n13">13</a></span> project = <span class="constant">Project</span>.find_by(<span class="key">id</span>: project_id)
</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">if</span> project == <span class="predefined-constant">nil</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> errors[<span class="symbol">:project</span>] = <span class="string"><span class="delimiter">&quot;</span><span class="content">project belong to projects_user is not exist</span><span class="delimiter">&quot;</span></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="#n16" name="n16">16</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="#n17" name="n17">17</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="#n18" name="n18">18</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="#n19" name="n19">19</a></span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
<ul>
<li>Complexity 2 &raquo; saikuro</li>
<li>NilCheck - performs a nil-check &raquo; reek</li>
</ul>
</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="keyword">def</span> <span class="function">user_exists</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="#n21" name="n21">21</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="#n22" name="n22">22</a></span> user = <span class="constant">User</span>.find_by(<span class="key">id</span>: user_id)
</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">if</span> user == <span class="predefined-constant">nil</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> errors[<span class="symbol">:user</span>] = <span class="string"><span class="delimiter">&quot;</span><span class="content">user belong to projects_user is not exist</span><span class="delimiter">&quot;</span></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="#n25" name="n25">25</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="#n26" name="n26">26</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="#n27" name="n27">27</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="#n28" name="n28">28</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="#n29" name="n29">29</a></span><span class="keyword">end</span></pre></div>
</div>
</td>
</tr>
</table>
</body>
</html>