(a)
(1) In any civil action in which the court having jurisdiction finds that there was a complete absence of a justiciable issue of either law or fact raised by the losing party or his attorney, the court shall award an attorney's fee in an amount not to exceed five thousand dollars ($5,000), or ten percent (10%) of the amount in controversy, whichever is less, to the prevailing party unless a voluntary dismissal is filed or the pleadings are amended as to any nonjusticiable issue within a reasonable time after the attorney or party filing the dismissal or the amended pleadings knew, or reasonably should have known, that he would not prevail.
(2) This section shall not apply to actions arising out of a written instrument or agreement which entitles the prevailing party to an award of reasonable attorney's fees.
(b) In order to find an action, claim, setoff, counterclaim, or defense to be lacking a justiciable issue of law or fact, the court must find that the action, claim, setoff, counterclaim, or defense was commenced, used, or continued in bad faith solely for purposes of harassing or maliciously injuring another or delaying adjudication without just cause or that the party or the party's attorney knew, or should have known, that the action, claim, setoff, counterclaim, or defense was without any reasonable basis in law or equity and could not be supported by a good faith argument for an extension, modification, or reversal of existing law.
(c) In awarding attorney's fees, the court may pronounce its decision on the fees at the conclusion of the trial or special proceedings without written motion and with or without presentation of additional evidence. The judgment for attorney's fees, if any, shall be included in the final judgment entered in the action.
(d) On appeal, the question as to whether there was a complete absence of a justiciable issue shall be determined de novo on the record of the trial court alone.