Skip to content

Commit

Permalink
fix(converterfactory.php): reviewed convert function for code optimis…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
AsifNawaz-cnic committed Mar 25, 2024
1 parent 7cd98a8 commit 7ae8bc7
Show file tree
Hide file tree
Showing 16 changed files with 596 additions and 639 deletions.
174 changes: 91 additions & 83 deletions reports/clover/coverage.xml
Original file line number Diff line number Diff line change
@@ -1,103 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1711110954">
<project timestamp="1711110954">
<coverage generated="1711361866">
<project timestamp="1711361866">
<file name="/home/asifnawaz/git/rtldev-middleware-php-idna-translator/src/IDNA/Converter/ASCIIConverter.php">
<class name="CNIC\IDNA\Converter\ASCIIConverter" namespace="global">
<metrics complexity="4" methods="2" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="6" elements="12" coveredelements="6"/>
<metrics complexity="4" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="9" elements="12" coveredelements="10"/>
</class>
<line num="15" type="method" name="convert" visibility="public" complexity="3" crap="3.33" count="2"/>
<line num="17" type="stmt" count="2"/>
<line num="20" type="stmt" count="2"/>
<line num="21" type="stmt" count="2"/>
<line num="22" type="stmt" count="2"/>
<line num="23" type="stmt" count="2"/>
<line num="24" type="stmt" count="2"/>
<line num="26" type="stmt" count="0"/>
<line num="27" type="stmt" count="0"/>
<line num="15" type="method" name="convert" visibility="public" complexity="3" crap="3.01" count="6"/>
<line num="17" type="stmt" count="6"/>
<line num="20" type="stmt" count="6"/>
<line num="21" type="stmt" count="6"/>
<line num="22" type="stmt" count="6"/>
<line num="23" type="stmt" count="6"/>
<line num="24" type="stmt" count="6"/>
<line num="26" type="stmt" count="6"/>
<line num="27" type="stmt" count="6"/>
<line num="29" type="stmt" count="0"/>
<line num="38" type="method" name="check" visibility="public" complexity="1" crap="2" count="0"/>
<line num="40" type="stmt" count="0"/>
<metrics loc="43" ncloc="27" classes="1" methods="2" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="6" elements="12" coveredelements="6"/>
<line num="38" type="method" name="check" visibility="public" complexity="1" crap="1" count="4"/>
<line num="40" type="stmt" count="4"/>
<metrics loc="43" ncloc="27" classes="1" methods="2" coveredmethods="1" conditionals="0" coveredconditionals="0" statements="10" coveredstatements="9" elements="12" coveredelements="10"/>
</file>
<file name="/home/asifnawaz/git/rtldev-middleware-php-idna-translator/src/IDNA/Converter/ConversionInterface.php">
<metrics loc="10" ncloc="10" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
</file>
<file name="/home/asifnawaz/git/rtldev-middleware-php-idna-translator/src/IDNA/Converter/UnicodeConverter.php">
<class name="CNIC\IDNA\Converter\UnicodeConverter" namespace="global">
<metrics complexity="5" methods="3" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="14" coveredstatements="5" elements="17" coveredelements="7"/>
<metrics complexity="6" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="15" coveredstatements="14" elements="19" coveredelements="17"/>
</class>
<line num="15" type="method" name="convert" visibility="public" complexity="3" crap="12" count="0"/>
<line num="17" type="stmt" count="0"/>
<line num="19" type="stmt" count="0"/>
<line num="20" type="stmt" count="0"/>
<line num="21" type="stmt" count="0"/>
<line num="22" type="stmt" count="0"/>
<line num="23" type="stmt" count="0"/>
<line num="24" type="stmt" count="0"/>
<line num="25" type="stmt" count="0"/>
<line num="15" type="method" name="convert" visibility="public" complexity="3" crap="3.01" count="6"/>
<line num="17" type="stmt" count="6"/>
<line num="19" type="stmt" count="6"/>
<line num="20" type="stmt" count="6"/>
<line num="21" type="stmt" count="6"/>
<line num="22" type="stmt" count="6"/>
<line num="23" type="stmt" count="6"/>
<line num="24" type="stmt" count="6"/>
<line num="25" type="stmt" count="6"/>
<line num="27" type="stmt" count="0"/>
<line num="36" type="method" name="check" visibility="public" complexity="1" crap="1" count="2"/>
<line num="38" type="stmt" count="2"/>
<line num="39" type="stmt" count="2"/>
<line num="40" type="stmt" count="2"/>
<line num="41" type="stmt" count="2"/>
<line num="50" type="method" name="decode" visibility="public" complexity="1" crap="1" count="2"/>
<line num="53" type="stmt" count="2"/>
<metrics loc="56" ncloc="34" classes="1" methods="3" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="14" coveredstatements="5" elements="17" coveredelements="7"/>
<line num="36" type="method" name="check" visibility="public" complexity="1" crap="1" count="7"/>
<line num="38" type="stmt" count="7"/>
<line num="39" type="stmt" count="7"/>
<line num="40" type="stmt" count="7"/>
<line num="41" type="stmt" count="7"/>
<line num="53" type="method" name="containsUnicodeCharacters" visibility="public" complexity="1" crap="1" count="5"/>
<line num="56" type="stmt" count="5"/>
<line num="65" type="method" name="decode" visibility="public" complexity="1" crap="1" count="7"/>
<line num="68" type="stmt" count="7"/>
<metrics loc="71" ncloc="39" classes="1" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="15" coveredstatements="14" elements="19" coveredelements="17"/>
</file>
<file name="/home/asifnawaz/git/rtldev-middleware-php-idna-translator/src/IDNA/Factory/ConverterFactory.php">
<class name="CNIC\IDNA\Factory\ConverterFactory" namespace="global">
<metrics complexity="23" methods="5" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="42" coveredstatements="12" elements="47" coveredelements="12"/>
<metrics complexity="24" methods="5" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="48" coveredstatements="46" elements="53" coveredelements="49"/>
</class>
<line num="18" type="method" name="convert" visibility="public" complexity="4" crap="20" count="0"/>
<line num="20" type="stmt" count="0"/>
<line num="21" type="stmt" count="0"/>
<line num="24" type="stmt" count="0"/>
<line num="25" type="stmt" count="0"/>
<line num="27" type="stmt" count="0"/>
<line num="28" type="stmt" count="0"/>
<line num="29" type="stmt" count="0"/>
<line num="32" type="stmt" count="0"/>
<line num="35" type="stmt" count="0"/>
<line num="36" type="stmt" count="0"/>
<line num="38" type="stmt" count="0"/>
<line num="48" type="method" name="toUnicode" visibility="public" complexity="6" crap="42" count="0"/>
<line num="50" type="stmt" count="0"/>
<line num="51" type="stmt" count="0"/>
<line num="54" type="stmt" count="0"/>
<line num="55" type="stmt" count="0"/>
<line num="57" type="stmt" count="0"/>
<line num="58" type="stmt" count="0"/>
<line num="59" type="stmt" count="0"/>
<line num="60" type="stmt" count="0"/>
<line num="61" type="stmt" count="0"/>
<line num="65" type="stmt" count="0"/>
<line num="76" type="method" name="toASCII" visibility="public" complexity="5" crap="5.02" count="2"/>
<line num="78" type="stmt" count="2"/>
<line num="79" type="stmt" count="1"/>
<line num="82" type="stmt" count="2"/>
<line num="83" type="stmt" count="0"/>
<line num="85" type="stmt" count="2"/>
<line num="86" type="stmt" count="2"/>
<line num="87" type="stmt" count="2"/>
<line num="88" type="stmt" count="2"/>
<line num="89" type="stmt" count="2"/>
<line num="90" type="stmt" count="2"/>
<line num="94" type="stmt" count="1"/>
<line num="106" type="method" name="handleConversion" visibility="private" complexity="6" crap="42" count="0"/>
<line num="108" type="stmt" count="0"/>
<line num="109" type="stmt" count="0"/>
<line num="110" type="stmt" count="0"/>
<line num="111" type="stmt" count="0"/>
<line num="115" type="stmt" count="0"/>
<line num="116" type="stmt" count="0"/>
<line num="119" type="stmt" count="0"/>
<line num="129" type="method" name="transitionalProcessing" visibility="public" complexity="2" crap="2.15" count="2"/>
<line num="131" type="stmt" count="2"/>
<line num="132" type="stmt" count="2"/>
<line num="135" type="stmt" count="0"/>
<metrics loc="138" ncloc="101" classes="1" methods="5" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="42" coveredstatements="12" elements="47" coveredelements="12"/>
<line num="17" type="method" name="convert" visibility="public" complexity="3" crap="3" count="3"/>
<line num="19" type="stmt" count="3"/>
<line num="20" type="stmt" count="2"/>
<line num="23" type="stmt" count="3"/>
<line num="25" type="stmt" count="3"/>
<line num="26" type="stmt" count="3"/>
<line num="27" type="stmt" count="3"/>
<line num="30" type="stmt" count="3"/>
<line num="40" type="method" name="toUnicode" visibility="public" complexity="6" crap="6.02" count="4"/>
<line num="42" type="stmt" count="4"/>
<line num="43" type="stmt" count="0"/>
<line num="46" type="stmt" count="4"/>
<line num="47" type="stmt" count="1"/>
<line num="49" type="stmt" count="4"/>
<line num="50" type="stmt" count="4"/>
<line num="52" type="stmt" count="4"/>
<line num="53" type="stmt" count="4"/>
<line num="54" type="stmt" count="3"/>
<line num="56" type="stmt" count="4"/>
<line num="57" type="stmt" count="4"/>
<line num="58" type="stmt" count="4"/>
<line num="62" type="stmt" count="4"/>
<line num="73" type="method" name="toASCII" visibility="public" complexity="5" crap="5" count="6"/>
<line num="75" type="stmt" count="6"/>
<line num="76" type="stmt" count="1"/>
<line num="79" type="stmt" count="6"/>
<line num="80" type="stmt" count="2"/>
<line num="82" type="stmt" count="6"/>
<line num="83" type="stmt" count="6"/>
<line num="84" type="stmt" count="6"/>
<line num="85" type="stmt" count="6"/>
<line num="86" type="stmt" count="6"/>
<line num="87" type="stmt" count="6"/>
<line num="91" type="stmt" count="6"/>
<line num="103" type="method" name="handleConversion" visibility="private" complexity="8" crap="8.02" count="3"/>
<line num="105" type="stmt" count="3"/>
<line num="106" type="stmt" count="3"/>
<line num="107" type="stmt" count="3"/>
<line num="108" type="stmt" count="3"/>
<line num="112" type="stmt" count="2"/>
<line num="113" type="stmt" count="2"/>
<line num="114" type="stmt" count="2"/>
<line num="115" type="stmt" count="2"/>
<line num="117" type="stmt" count="2"/>
<line num="118" type="stmt" count="1"/>
<line num="119" type="stmt" count="1"/>
<line num="122" type="stmt" count="1"/>
<line num="123" type="stmt" count="0"/>
<line num="126" type="stmt" count="2"/>
<line num="136" type="method" name="transitionalProcessing" visibility="public" complexity="2" crap="2" count="7"/>
<line num="138" type="stmt" count="7"/>
<line num="139" type="stmt" count="4"/>
<line num="142" type="stmt" count="3"/>
<metrics loc="145" ncloc="109" classes="1" methods="5" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="48" coveredstatements="46" elements="53" coveredelements="49"/>
</file>
<metrics files="4" loc="247" ncloc="172" classes="3" methods="10" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="66" coveredstatements="23" elements="76" coveredelements="25"/>
<metrics files="4" loc="269" ncloc="185" classes="3" methods="11" coveredmethods="7" conditionals="0" coveredconditionals="0" statements="73" coveredstatements="69" elements="84" coveredelements="76"/>
</project>
</coverage>
Loading

0 comments on commit 7ae8bc7

Please sign in to comment.