mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Deploying to gh-pages from @ ecbea0b470
🚀
This commit is contained in:
parent
aae8042913
commit
cee43e003c
102 changed files with 611 additions and 615 deletions
|
@ -693,7 +693,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/any_after_filter.cr#L27" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/any_after_filter.cr#L27" target="_blank">
|
||||
ameba/rule/performance/any_after_filter.cr
|
||||
</a>
|
||||
|
||||
|
@ -1002,7 +1002,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/any_after_filter.cr#L27" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/any_after_filter.cr#L27" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1172,7 +1172,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/any_after_filter.cr#L36" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/any_after_filter.cr#L36" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -694,7 +694,7 @@ one value present.</p>
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/any_instead_of_empty.cr#L28" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/any_instead_of_empty.cr#L28" target="_blank">
|
||||
ameba/rule/performance/any_instead_of_empty.cr
|
||||
</a>
|
||||
|
||||
|
@ -994,7 +994,7 @@ one value present.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/any_instead_of_empty.cr#L28" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/any_instead_of_empty.cr#L28" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1136,7 +1136,7 @@ one value present.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/any_instead_of_empty.cr#L36" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/any_instead_of_empty.cr#L36" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -703,7 +703,7 @@ chars <span class="o">=</span> names
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/chained_call_with_no_bang.cr#L37" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/chained_call_with_no_bang.cr#L37" target="_blank">
|
||||
ameba/rule/performance/chained_call_with_no_bang.cr
|
||||
</a>
|
||||
|
||||
|
@ -1031,7 +1031,7 @@ chars <span class="o">=</span> names
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/chained_call_with_no_bang.cr#L37" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/chained_call_with_no_bang.cr#L37" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1201,7 +1201,7 @@ chars <span class="o">=</span> names
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/chained_call_with_no_bang.cr#L66" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/chained_call_with_no_bang.cr#L66" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1217,7 +1217,7 @@ chars <span class="o">=</span> names
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/chained_call_with_no_bang.cr#L57" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/chained_call_with_no_bang.cr#L57" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -688,7 +688,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/compact_after_map.cr#L22" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/compact_after_map.cr#L22" target="_blank">
|
||||
ameba/rule/performance/compact_after_map.cr
|
||||
</a>
|
||||
|
||||
|
@ -992,7 +992,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/compact_after_map.cr#L22" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/compact_after_map.cr#L22" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1134,7 +1134,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/compact_after_map.cr#L40" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/compact_after_map.cr#L40" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1150,7 +1150,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/compact_after_map.cr#L31" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/compact_after_map.cr#L31" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -692,7 +692,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/first_last_after_filter.cr#L26" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/first_last_after_filter.cr#L26" target="_blank">
|
||||
ameba/rule/performance/first_last_after_filter.cr
|
||||
</a>
|
||||
|
||||
|
@ -1010,7 +1010,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/first_last_after_filter.cr#L26" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/first_last_after_filter.cr#L26" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1180,7 +1180,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/first_last_after_filter.cr#L45" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/first_last_after_filter.cr#L45" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1196,7 +1196,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/first_last_after_filter.cr#L36" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/first_last_after_filter.cr#L36" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -688,7 +688,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/flatten_after_map.cr#L22" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/flatten_after_map.cr#L22" target="_blank">
|
||||
ameba/rule/performance/flatten_after_map.cr
|
||||
</a>
|
||||
|
||||
|
@ -992,7 +992,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/flatten_after_map.cr#L22" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/flatten_after_map.cr#L22" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1134,7 +1134,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/flatten_after_map.cr#L40" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/flatten_after_map.cr#L40" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1150,7 +1150,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/flatten_after_map.cr#L31" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/flatten_after_map.cr#L31" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -634,18 +634,16 @@
|
|||
Overview
|
||||
</h2>
|
||||
|
||||
<p>This rule is used to identify usage of <code>join/sum/product</code> calls
|
||||
<p>This rule is used to identify usage of <code>sum/product</code> calls
|
||||
that follow <code>map</code>.</p>
|
||||
|
||||
<p>For example, this is considered inefficient:</p>
|
||||
|
||||
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).map(<span class="o">&</span>.to_s).join(<span class="s">'.'</span>)
|
||||
(<span class="n">1</span>..<span class="n">3</span>).map(<span class="o">&</span>.<span class="o">*</span>(<span class="n">2</span>)).sum</code></pre>
|
||||
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).map(<span class="o">&</span>.<span class="o">*</span>(<span class="n">2</span>)).sum</code></pre>
|
||||
|
||||
<p>And can be written as this:</p>
|
||||
|
||||
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).join(<span class="s">'.'</span>, <span class="o">&</span>.to_s)
|
||||
(<span class="n">1</span>..<span class="n">3</span>).sum(<span class="o">&</span>.<span class="o">*</span>(<span class="n">2</span>))</code></pre>
|
||||
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).sum(<span class="o">&</span>.<span class="o">*</span>(<span class="n">2</span>))</code></pre>
|
||||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
|
@ -691,7 +689,7 @@ that follow <code>map</code>.</p>
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/map_instead_of_block.cr#L25" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/map_instead_of_block.cr#L23" target="_blank">
|
||||
ameba/rule/performance/map_instead_of_block.cr
|
||||
</a>
|
||||
|
||||
|
@ -713,7 +711,7 @@ that follow <code>map</code>.</p>
|
|||
<dl>
|
||||
|
||||
<dt class="entry-const" id="CALL_NAMES">
|
||||
<strong>CALL_NAMES</strong> = <code>[<span class="s">"join"</span>, <span class="s">"sum"</span>, <span class="s">"product"</span>] <span class="k">of</span> <span class="t">::</span><span class="t">String</span></code>
|
||||
<strong>CALL_NAMES</strong> = <code>[<span class="s">"sum"</span>, <span class="s">"product"</span>] <span class="k">of</span> <span class="t">::</span><span class="t">String</span></code>
|
||||
</dt>
|
||||
|
||||
|
||||
|
@ -749,7 +747,7 @@ that follow <code>map</code>.</p>
|
|||
<li class="entry-summary">
|
||||
<a href="#new(config=nil)-class-method" class="signature"><strong>.new</strong>(config = <span class="n">nil</span>)</a>
|
||||
|
||||
<div class="summary"><p>This rule is used to identify usage of <code>join/sum/product</code> calls that follow <code>map</code>.</p></div>
|
||||
<div class="summary"><p>This rule is used to identify usage of <code>sum/product</code> calls that follow <code>map</code>.</p></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -785,7 +783,7 @@ that follow <code>map</code>.</p>
|
|||
</li>
|
||||
|
||||
<li class="entry-summary">
|
||||
<a href="#enabled=(enabled:Bool)-instance-method" class="signature"><strong>#enabled=</strong>(enabled : Bool)</a>
|
||||
<a href="#enabled=(enabled)-instance-method" class="signature"><strong>#enabled=</strong>(enabled)</a>
|
||||
|
||||
</li>
|
||||
|
||||
|
@ -976,18 +974,16 @@ that follow <code>map</code>.</p>
|
|||
|
||||
<div class="doc">
|
||||
|
||||
<p>This rule is used to identify usage of <code>join/sum/product</code> calls
|
||||
<p>This rule is used to identify usage of <code>sum/product</code> calls
|
||||
that follow <code>map</code>.</p>
|
||||
|
||||
<p>For example, this is considered inefficient:</p>
|
||||
|
||||
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).map(<span class="o">&</span>.to_s).join(<span class="s">'.'</span>)
|
||||
(<span class="n">1</span>..<span class="n">3</span>).map(<span class="o">&</span>.<span class="o">*</span>(<span class="n">2</span>)).sum</code></pre>
|
||||
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).map(<span class="o">&</span>.<span class="o">*</span>(<span class="n">2</span>)).sum</code></pre>
|
||||
|
||||
<p>And can be written as this:</p>
|
||||
|
||||
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).join(<span class="s">'.'</span>, <span class="o">&</span>.to_s)
|
||||
(<span class="n">1</span>..<span class="n">3</span>).sum(<span class="o">&</span>.<span class="o">*</span>(<span class="n">2</span>))</code></pre>
|
||||
<pre><code class="language-crystal">(<span class="n">1</span>..<span class="n">3</span>).sum(<span class="o">&</span>.<span class="o">*</span>(<span class="n">2</span>))</code></pre>
|
||||
|
||||
<p>YAML configuration example:</p>
|
||||
|
||||
|
@ -998,7 +994,7 @@ that follow <code>map</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/map_instead_of_block.cr#L25" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/map_instead_of_block.cr#L23" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1059,12 +1055,12 @@ that follow <code>map</code>.</p>
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entry-detail" id="enabled=(enabled:Bool)-instance-method">
|
||||
<div class="entry-detail" id="enabled=(enabled)-instance-method">
|
||||
<div class="signature">
|
||||
|
||||
def <strong>enabled=</strong>(enabled : Bool)
|
||||
def <strong>enabled=</strong>(enabled)
|
||||
|
||||
<a class="method-permalink" href="#enabled=(enabled:Bool)-instance-method">#</a>
|
||||
<a class="method-permalink" href="#enabled=(enabled)-instance-method">#</a>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
|
@ -1140,7 +1136,7 @@ that follow <code>map</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/map_instead_of_block.cr#L44" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/map_instead_of_block.cr#L41" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1156,7 +1152,7 @@ that follow <code>map</code>.</p>
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/map_instead_of_block.cr#L35" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/map_instead_of_block.cr#L32" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -699,7 +699,7 @@
|
|||
</h2>
|
||||
|
||||
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/size_after_filter.cr#L33" target="_blank">
|
||||
<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/size_after_filter.cr#L33" target="_blank">
|
||||
ameba/rule/performance/size_after_filter.cr
|
||||
</a>
|
||||
|
||||
|
@ -1019,7 +1019,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/size_after_filter.cr#L33" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/size_after_filter.cr#L33" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1189,7 +1189,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/size_after_filter.cr#L51" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/size_after_filter.cr#L51" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1205,7 +1205,7 @@
|
|||
<br/>
|
||||
<div>
|
||||
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/9a25214b/src/ameba/rule/performance/size_after_filter.cr#L42" target="_blank">View source</a>]
|
||||
[<a href="https://github.com/crystal-ameba/ameba/blob/ecbea0b4/src/ameba/rule/performance/size_after_filter.cr#L42" target="_blank">View source</a>]
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue