ambition/reports/metric_fu/output/62e9dd18e626544eade9ed0b20d...

835 lines
20 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'>
&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">Note</span> &lt; <span class="constant">ActiveRecord</span>:: <span class="constant">Base</span>
</pre></div>
</div>
</td>
</tr>
<tr>
<td valign='top'>
<ul>
<li>remove trailing whitespace &raquo; rails_best_practices</li>
</ul>
</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> belongs_to <span class="symbol">:user</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> validates <span class="symbol">:content</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="#n6" name="n6">6</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="#n7" name="n7">7</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="#n8" name="n8">8</a></span> validates <span class="symbol">:category</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="#n9" name="n9">9</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="#n10" name="n10">10</a></strong></span> validate <span class="symbol">:note_has_atleast_one_character</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> validate <span class="symbol">:note_category_should_among_valid_values</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> validate <span class="symbol">:user_exist</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="#n13" name="n13">13</a></span> validate <span class="symbol">:project_exist</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="#n14" name="n14">14</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="#n15" name="n15">15</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="#n16" name="n16">16</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"><a href="#n17" name="n17">17</a></span> <span class="keyword">def</span> <span class="function">note_has_atleast_one_character</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> tmp = content.strip
</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="keyword">if</span> tmp.length &lt; <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"><strong><a href="#n20" name="n20">20</a></strong></span> errors[<span class="symbol">:content</span>] = <span class="string"><span class="delimiter">&quot;</span><span class="content">note content should has at least one character</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="#n21" name="n21">21</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="#n22" name="n22">22</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="#n23" name="n23">23</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="#n24" name="n24">24</a></span> <span class="keyword">def</span> <span class="function">note_category_should_among_valid_values</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>
</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> <span class="keyword">if</span> category != <span class="integer">1</span> <span class="keyword">and</span> category != <span class="integer">2</span> <span class="keyword">and</span> category !=<span class="integer">3</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> errors[<span class="symbol">:category</span>] = <span class="string"><span class="delimiter">&quot;</span><span class="content">note category is not among valid values</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="#n28" name="n28">28</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="#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>
</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="keyword">def</span> <span class="function">user_exist</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>
</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> 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="#n35" name="n35">35</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="#n36" name="n36">36</a></span> errors[<span class="symbol">:user</span>] = <span class="string"><span class="delimiter">&quot;</span><span class="content">user belong to Note 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="#n37" name="n37">37</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="#n38" name="n38">38</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="#n39" name="n39">39</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"><strong><a href="#n40" name="n40">40</a></strong></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="#n41" name="n41">41</a></span> <span class="keyword">def</span> <span class="function">project_exist</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="#n42" name="n42">42</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="#n43" name="n43">43</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="#n44" name="n44">44</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="#n45" name="n45">45</a></span> errors[<span class="symbol">:project</span>] = <span class="string"><span class="delimiter">&quot;</span><span class="content">project should be 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="#n46" name="n46">46</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="#n47" name="n47">47</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="#n48" name="n48">48</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="#n49" name="n49">49</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="#n50" name="n50">50</a></strong></span><span class="keyword">end</span></pre></div>
</div>
</td>
</tr>
</table>
</body>
</html>