dusterio/link-preview

View on GitHub
build/logs/clover.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<coverage generated="1458369831">
  <project timestamp="1458369831">
    <package name="Dusterio\LinkPreview">
      <file name="/Users/duster/repos/link-preview/src/Client.php">
        <class name="Client" namespace="Dusterio\LinkPreview">
          <metrics methods="10" coveredmethods="8" conditionals="0" coveredconditionals="0" statements="26" coveredstatements="23" elements="36" coveredelements="31"/>
        </class>
        <line num="27" type="method" name="__construct" crap="2" count="5"/>
        <line num="29" type="stmt" count="5"/>
        <line num="30" type="stmt" count="5"/>
        <line num="31" type="stmt" count="5"/>
        <line num="37" type="method" name="getPreviews" crap="3" count="1"/>
        <line num="39" type="stmt" count="1"/>
        <line num="41" type="stmt" count="1"/>
        <line num="42" type="stmt" count="1"/>
        <line num="43" type="stmt" count="1"/>
        <line num="46" type="stmt" count="1"/>
        <line num="55" type="method" name="getPreview" crap="2.06" count="1"/>
        <line num="57" type="stmt" count="1"/>
        <line num="58" type="stmt" count="1"/>
        <line num="59" type="stmt" count="0"/>
        <line num="61" type="stmt" count="1"/>
        <line num="70" type="method" name="addParser" crap="1" count="5"/>
        <line num="72" type="stmt" count="5"/>
        <line num="74" type="stmt" count="5"/>
        <line num="81" type="method" name="getParsers" crap="1" count="5"/>
        <line num="83" type="stmt" count="5"/>
        <line num="91" type="method" name="setParsers" crap="2" count="0"/>
        <line num="93" type="stmt" count="0"/>
        <line num="95" type="stmt" count="0"/>
        <line num="101" type="method" name="getUrl" crap="2" count="1"/>
        <line num="103" type="stmt" count="1"/>
        <line num="112" type="method" name="setUrl" crap="1" count="5"/>
        <line num="114" type="stmt" count="5"/>
        <line num="116" type="stmt" count="5"/>
        <line num="125" type="method" name="removeParser" crap="2" count="1"/>
        <line num="127" type="stmt" count="1"/>
        <line num="128" type="stmt" count="1"/>
        <line num="131" type="stmt" count="1"/>
        <line num="138" type="method" name="addDefaultParsers" crap="1" count="5"/>
        <line num="140" type="stmt" count="5"/>
        <line num="141" type="stmt" count="5"/>
        <line num="142" type="stmt" count="5"/>
        <metrics loc="142" ncloc="89" classes="1" methods="10" coveredmethods="8" conditionals="0" coveredconditionals="0" statements="26" coveredstatements="23" elements="36" coveredelements="31"/>
      </file>
    </package>
    <file name="/Users/duster/repos/link-preview/src/Contracts/LinkInterface.php">
      <metrics loc="77" ncloc="27" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
    </file>
    <file name="/Users/duster/repos/link-preview/src/Contracts/ParserInterface.php">
      <metrics loc="61" ncloc="22" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
    </file>
    <file name="/Users/duster/repos/link-preview/src/Contracts/PreviewInterface.php">
      <metrics loc="28" ncloc="11" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
    </file>
    <file name="/Users/duster/repos/link-preview/src/Contracts/ReaderInterface.php">
      <metrics loc="15" ncloc="7" classes="0" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
    </file>
    <package name="Dusterio\LinkPreview\Exceptions">
      <file name="/Users/duster/repos/link-preview/src/Exceptions/MalformedUrlException.php">
        <class name="MalformedUrlException" namespace="Dusterio\LinkPreview\Exceptions" fullPackage="Dusterio" package="Dusterio">
          <metrics methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
        </class>
        <metrics loc="12" ncloc="7" classes="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
      </file>
      <file name="/Users/duster/repos/link-preview/src/Exceptions/UnknownFieldException.php">
        <class name="UnknownFieldException" namespace="Dusterio\LinkPreview\Exceptions" fullPackage="Dusterio" package="Dusterio">
          <metrics methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
        </class>
        <metrics loc="11" ncloc="6" classes="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
      </file>
      <file name="/Users/duster/repos/link-preview/src/Exceptions/UnknownParserException.php">
        <class name="UnknownParserException" namespace="Dusterio\LinkPreview\Exceptions" fullPackage="Dusterio" package="Dusterio">
          <metrics methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
        </class>
        <metrics loc="12" ncloc="7" classes="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
      </file>
    </package>
    <package name="Dusterio\LinkPreview\Integrations">
      <file name="/Users/duster/repos/link-preview/src/Integrations/LaravelFacade.php">
        <class name="LaravelFacade" namespace="Dusterio\LinkPreview\Integrations" fullPackage="Dusterio" package="Dusterio">
          <metrics methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
        </class>
        <metrics loc="22" ncloc="12" classes="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
      </file>
      <file name="/Users/duster/repos/link-preview/src/Integrations/LaravelServiceProvider.php">
        <class name="LaravelServiceProvider" namespace="Dusterio\LinkPreview\Integrations" fullPackage="Dusterio" package="Dusterio">
          <metrics methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
        </class>
        <metrics loc="51" ncloc="26" classes="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
      </file>
    </package>
    <package name="Dusterio\LinkPreview\Models">
      <file name="/Users/duster/repos/link-preview/src/Models/HtmlPreview.php">
        <class name="HtmlPreview" namespace="Dusterio\LinkPreview\Models">
          <metrics methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
        </class>
        <metrics loc="43" ncloc="27" classes="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
      </file>
      <file name="/Users/duster/repos/link-preview/src/Models/Link.php">
        <class name="Link" namespace="Dusterio\LinkPreview\Models">
          <metrics methods="11" coveredmethods="8" conditionals="0" coveredconditionals="0" statements="18" coveredstatements="14" elements="29" coveredelements="22"/>
        </class>
        <line num="37" type="method" name="__construct" crap="2" count="8"/>
        <line num="39" type="stmt" count="8"/>
        <line num="40" type="stmt" count="2"/>
        <line num="43" type="stmt" count="6"/>
        <line num="44" type="stmt" count="6"/>
        <line num="49" type="method" name="getContent" crap="1" count="1"/>
        <line num="51" type="stmt" count="1"/>
        <line num="57" type="method" name="setContent" crap="1" count="1"/>
        <line num="59" type="stmt" count="1"/>
        <line num="61" type="stmt" count="1"/>
        <line num="67" type="method" name="getContentType" crap="1" count="1"/>
        <line num="69" type="stmt" count="1"/>
        <line num="75" type="method" name="setContentType" crap="1" count="1"/>
        <line num="77" type="stmt" count="1"/>
        <line num="79" type="stmt" count="1"/>
        <line num="85" type="method" name="getUrl" crap="1" count="4"/>
        <line num="87" type="stmt" count="4"/>
        <line num="93" type="method" name="setUrl" crap="1" count="6"/>
        <line num="95" type="stmt" count="6"/>
        <line num="97" type="stmt" count="6"/>
        <line num="102" type="method" name="getEffectiveUrl" crap="1" count="1"/>
        <line num="104" type="stmt" count="1"/>
        <line num="110" type="method" name="setEffectiveUrl" crap="2" count="0"/>
        <line num="112" type="stmt" count="0"/>
        <line num="114" type="stmt" count="0"/>
        <line num="120" type="method" name="isHtml" crap="2" count="0"/>
        <line num="122" type="stmt" count="0"/>
        <line num="128" type="method" name="isImage" crap="2" count="0"/>
        <line num="130" type="stmt" count="0"/>
        <metrics loc="132" ncloc="83" classes="1" methods="11" coveredmethods="8" conditionals="0" coveredconditionals="0" statements="18" coveredstatements="14" elements="29" coveredelements="22"/>
      </file>
      <file name="/Users/duster/repos/link-preview/src/Models/VideoPreview.php">
        <class name="VideoPreview" namespace="Dusterio\LinkPreview\Models">
          <metrics methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
        </class>
        <metrics loc="38" ncloc="23" classes="1" methods="0" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="0" coveredstatements="0" elements="0" coveredelements="0"/>
      </file>
    </package>
    <package name="Dusterio\LinkPreview\Parsers">
      <file name="/Users/duster/repos/link-preview/src/Parsers/BaseParser.php">
        <class name="BaseParser" namespace="Dusterio\LinkPreview\Parsers">
          <metrics methods="5" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="7" coveredstatements="5" elements="12" coveredelements="8"/>
        </class>
        <line num="24" type="method" name="getPreview" crap="1" count="1"/>
        <line num="26" type="stmt" count="1"/>
        <line num="32" type="method" name="setPreview" crap="1" count="5"/>
        <line num="34" type="stmt" count="5"/>
        <line num="36" type="stmt" count="5"/>
        <line num="42" type="method" name="getReader" crap="2" count="0"/>
        <line num="44" type="stmt" count="0"/>
        <line num="51" type="method" name="setReader" crap="1" count="5"/>
        <line num="53" type="stmt" count="5"/>
        <line num="55" type="stmt" count="5"/>
        <line num="63" type="method" name="readLink" crap="2" count="0"/>
        <line num="65" type="stmt" count="0"/>
        <metrics loc="66" ncloc="42" classes="1" methods="5" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="7" coveredstatements="5" elements="12" coveredelements="8"/>
      </file>
      <file name="/Users/duster/repos/link-preview/src/Parsers/HtmlParser.php">
        <class name="HtmlParser" namespace="Dusterio\LinkPreview\Parsers">
          <metrics methods="7" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="36" coveredstatements="4" elements="43" coveredelements="6"/>
        </class>
        <line num="56" type="method" name="__construct" crap="3" count="5"/>
        <line num="58" type="stmt" count="5"/>
        <line num="59" type="stmt" count="5"/>
        <line num="60" type="stmt" count="5"/>
        <line num="65" type="method" name="__toString" crap="1" count="6"/>
        <line num="67" type="stmt" count="6"/>
        <line num="75" type="method" name="setMinimumImageDimension" crap="2" count="0"/>
        <line num="77" type="stmt" count="0"/>
        <line num="78" type="stmt" count="0"/>
        <line num="79" type="stmt" count="0"/>
        <line num="84" type="method" name="canParseLink" crap="2" count="0"/>
        <line num="86" type="stmt" count="0"/>
        <line num="92" type="method" name="parseLink" crap="12" count="0"/>
        <line num="94" type="stmt" count="0"/>
        <line num="96" type="stmt" count="0"/>
        <line num="97" type="stmt" count="0"/>
        <line num="98" type="stmt" count="0"/>
        <line num="99" type="stmt" count="0"/>
        <line num="102" type="stmt" count="0"/>
        <line num="109" type="method" name="parseImage" crap="2" count="0"/>
        <line num="112" type="stmt" count="0"/>
        <line num="114" type="stmt" count="0"/>
        <line num="124" type="method" name="parseHtml" crap="272" count="0"/>
        <line num="126" type="stmt" count="0"/>
        <line num="129" type="stmt" count="0"/>
        <line num="132" type="stmt" count="0"/>
        <line num="133" type="stmt" count="0"/>
        <line num="134" type="stmt" count="0"/>
        <line num="135" type="stmt" count="0"/>
        <line num="136" type="stmt" count="0"/>
        <line num="138" type="stmt" count="0"/>
        <line num="141" type="stmt" count="0"/>
        <line num="146" type="stmt" count="0"/>
        <line num="150" type="stmt" count="0"/>
        <line num="151" type="stmt" count="0"/>
        <line num="152" type="stmt" count="0"/>
        <line num="155" type="stmt" count="0"/>
        <line num="156" type="stmt" count="0"/>
        <line num="158" type="stmt" count="0"/>
        <line num="160" type="stmt" count="0"/>
        <line num="164" type="stmt" count="0"/>
        <line num="166" type="stmt" count="0"/>
        <line num="168" type="stmt" count="0"/>
        <metrics loc="169" ncloc="121" classes="1" methods="7" coveredmethods="2" conditionals="0" coveredconditionals="0" statements="36" coveredstatements="4" elements="43" coveredelements="6"/>
      </file>
      <file name="/Users/duster/repos/link-preview/src/Parsers/YouTubeParser.php">
        <class name="YouTubeParser" namespace="Dusterio\LinkPreview\Parsers">
          <metrics methods="4" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="11" coveredstatements="11" elements="15" coveredelements="15"/>
        </class>
        <line num="26" type="method" name="__construct" crap="3" count="5"/>
        <line num="28" type="stmt" count="5"/>
        <line num="29" type="stmt" count="5"/>
        <line num="30" type="stmt" count="5"/>
        <line num="35" type="method" name="__toString" crap="1" count="6"/>
        <line num="37" type="stmt" count="6"/>
        <line num="43" type="method" name="canParseLink" crap="1" count="1"/>
        <line num="45" type="stmt" count="1"/>
        <line num="51" type="method" name="parseLink" crap="1" count="1"/>
        <line num="53" type="stmt" count="1"/>
        <line num="55" type="stmt" count="1"/>
        <line num="56" type="stmt" count="1"/>
        <line num="57" type="stmt" count="1"/>
        <line num="58" type="stmt" count="1"/>
        <line num="61" type="stmt" count="1"/>
        <metrics loc="62" ncloc="43" classes="1" methods="4" coveredmethods="4" conditionals="0" coveredconditionals="0" statements="11" coveredstatements="11" elements="15" coveredelements="15"/>
      </file>
    </package>
    <package name="Dusterio\LinkPreview\Readers">
      <file name="/Users/duster/repos/link-preview/src/Readers/HttpReader.php">
        <class name="HttpReader" namespace="Dusterio\LinkPreview\Readers">
          <metrics methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="11" coveredstatements="10" elements="15" coveredelements="13"/>
        </class>
        <line num="24" type="method" name="getClient" crap="2.15" count="1"/>
        <line num="26" type="stmt" count="1"/>
        <line num="27" type="stmt" count="0"/>
        <line num="30" type="stmt" count="1"/>
        <line num="36" type="method" name="setClient" crap="1" count="1"/>
        <line num="38" type="stmt" count="1"/>
        <line num="39" type="stmt" count="1"/>
        <line num="44" type="method" name="readLink" crap="1" count="1"/>
        <line num="46" type="stmt" count="1"/>
        <line num="47" type="stmt" count="1"/>
        <line num="49" type="stmt" count="1"/>
        <line num="50" type="stmt" count="1"/>
        <line num="51" type="stmt" count="1"/>
        <line num="52" type="method" name="anonymous function" crap="1" count="1"/>
        <line num="54" type="stmt" count="1"/>
        <line num="57" type="stmt" count="1"/>
        <line num="58" type="stmt" count="1"/>
        <line num="60" type="stmt" count="1"/>
        <metrics loc="62" ncloc="47" classes="1" methods="4" coveredmethods="3" conditionals="0" coveredconditionals="0" statements="14" coveredstatements="13" elements="18" coveredelements="16"/>
      </file>
    </package>
    <package name="Dusterio\LinkPreview\Traits">
      <file name="/Users/duster/repos/link-preview/src/Traits/HasExportableFields.php">
        <class name="HasExportableFields" namespace="Dusterio\LinkPreview\Traits">
          <metrics methods="2" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="6" coveredstatements="0" elements="8" coveredelements="0"/>
        </class>
        <line num="10" type="method" name="getFields" crap="6" count="0"/>
        <line num="12" type="stmt" count="0"/>
        <line num="18" type="method" name="toArray" crap="12" count="0"/>
        <line num="20" type="stmt" count="0"/>
        <line num="22" type="stmt" count="0"/>
        <line num="24" type="stmt" count="0"/>
        <line num="25" type="stmt" count="0"/>
        <line num="28" type="stmt" count="0"/>
        <metrics loc="29" ncloc="23" classes="1" methods="2" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="6" coveredstatements="0" elements="8" coveredelements="0"/>
      </file>
      <file name="/Users/duster/repos/link-preview/src/Traits/HasImportableFields.php">
        <class name="HasImportableFields" namespace="Dusterio\LinkPreview\Traits">
          <metrics methods="2" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="17" coveredstatements="7" elements="19" coveredelements="7"/>
        </class>
        <line num="15" type="method" name="__call" crap="10.54" count="1"/>
        <line num="17" type="stmt" count="1"/>
        <line num="18" type="stmt" count="1"/>
        <line num="20" type="stmt" count="1"/>
        <line num="21" type="stmt" count="0"/>
        <line num="24" type="stmt" count="1"/>
        <line num="25" type="stmt" count="0"/>
        <line num="26" type="stmt" count="1"/>
        <line num="28" type="stmt" count="1"/>
        <line num="30" type="stmt" count="0"/>
        <line num="31" type="stmt" count="1"/>
        <line num="33" type="stmt" count="0"/>
        <line num="36" type="stmt" count="0"/>
        <line num="41" type="method" name="update" crap="20" count="0"/>
        <line num="43" type="stmt" count="0"/>
        <line num="44" type="stmt" count="0"/>
        <line num="45" type="stmt" count="0"/>
        <line num="48" type="stmt" count="0"/>
        <line num="50" type="stmt" count="0"/>
        <metrics loc="50" ncloc="41" classes="1" methods="2" coveredmethods="0" conditionals="0" coveredconditionals="0" statements="17" coveredstatements="7" elements="19" coveredelements="7"/>
      </file>
    </package>
    <metrics files="19" loc="1082" ncloc="664" classes="15" methods="45" coveredmethods="28" conditionals="0" coveredconditionals="0" statements="135" coveredstatements="77" elements="180" coveredelements="105"/>
  </project>
</coverage>