
788 A.2d 455 (2002)
Norman LAURENCE
v.
Russell SOLLITTO et al.
No. 2000-307-APPEAL.
Supreme Court of Rhode Island.
January 9, 2002.
*456 Present LEDERBERG, BOURCIER, FLANDERS, and GOLDBERG, JJ.
Norman Laurence, for plaintiff.
Robert D. Parrillo/Thomas A. Palombo, Providence for defendant.

OPINION
GOLDBERG, Justice.
This case came before the Supreme Court on October 31, 2001, on appeal by the plaintiff, Norman Laurence (plaintiff or Laurence), from a final judgment of the Superior Court granting the defendant, Russell Sollitto's (defendant or Sollitto) motion to dismiss plaintiff's complaint for failure to state a claim upon which relief can be granted. We deny and dismiss plaintiff's appeal and affirm the Superior Court judgment.

Facts and Travel
In October 1997, Laurence was indicted for conspiracy to murder and first-degree murder of Betty Jo Gardiner. Sollitto was his court-appointed attorney and served in that capacity from February 1998 until November 1998, when he withdrew his appearance after a hearing on a motion to suppress plaintiff's confession. After Laurence dismissed two more court-appointed attorneys, he elected to proceed pro se at trial and was convicted of both counts. He was sentenced to life in prison without parole for the murder and ten years in prison for conspiracy to murder. The appeal in the criminal case is pending before this Court. Although plaintiff made numerous allegations of wrongdoing by Sollitto, the complaint asserted two causes of action; attorney malpractice and civil rights violations subject to 42 U.S.C. § 1983. Laurence sought compensatory and punitive damages. The trial justice granted Sollitto's motion to dismiss the complaint concluding that Laurence failed to set forth a cognizable claim pursuant to Rule 12(b) (1) and (6) of the Superior Court Rules of Civil Procedure.

Standard of Review
"[T]he sole function of a motion to dismiss is to test the sufficiency of the complaint." Rhode Island Affiliate, ACLU, Inc. v. Bernasconi, 557 A.2d 1232, 1232 (R.I.1989). "When ruling on a Rule 12(b)(6) motion [to dismiss], the trial justice must look no further than the complaint, assume that all allegations in the complaint are true, and resolve any doubts in a plaintiff's favor." Id. "The motion may then only be granted if it `appears beyond a reasonable doubt that a plaintiff would not be entitled to relief under any conceivable set of facts * * *.'" Id.
As a preliminary matter, we note that the record in this case reflects that exhibits and other materials, including a certified copy of plaintiff's criminal docket sheet and a copy of the transcript of the hearing on Laurence's motion to suppress *457 his confession, were attached to defendant's motion to dismiss. The purpose of a Rule 12(b)(6) motion is to test the legal sufficiency of the complaint, which must be determined without resort to extraneous materials. However, a trial justice need not reject affidavits or other evidence presented to the court to support such a motion. Rule 12(b) provides that when the materials are "not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in Rule 56, and all parties shall be given reasonable opportunity to present all material made pertinent to such motion by Rule 56."
Here, it is unclear whether the hearing justice considered the extraneous material attached to defendant's motion. The sufficiency of the complaint is, however, the threshold inquiry and as such, we have considered plaintiff's appeal using that standard. We conclude that the fatal flaws inherent in plaintiff's claims are apparent on the face of the complaint without resort to other documents; thus, we are satisfied that any error in considering extraneous materials, without first permitting plaintiff a reasonable opportunity to respond, is harmless error. We reiterate, however, that when extraneous material is included in a Rule 12(b)(6) motion, he or she is obliged to provide the opposing party a reasonable opportunity to respond, as the proceeding has been converted into one for summary judgment.

I

Defendant's 42 U.S.C. § 1983 Claims
Money damages for constitutional torts, such as those being sought by the plaintiff, are recoverable in civil actions pursuant to 42 U.S.C. § 1983.[1] It is well settled that 42 U.S.C. § 1983 claims are cognizable only for constitutional violations committed by persons acting under color of state law. Brunelle v. Town of South Kingstown, 700 A.2d 1075, 1081 (R.I.1987) (citing Parratt v. Taylor, 451 U.S. 527, 535, 101 S.Ct. 1908, 1912, 69 L.Ed.2d 420, 428 (1981)). A jurisdictional requisite for a 42 U.S.C. § 1983 action is that the alleged wrongdoer was acting under color of state law. Brunelle, 700 A.2d at 1081. We are not persuaded that an attorney appointed to represent an indigent offender is, simply by virtue of a court appointment, acting under color of law. For plaintiff to recover money damages from his court-appointed counsel, Sollitto must be found to be a state actor. Although we have not had occasion to pass upon this precise question, the United States Supreme Court has held that "the duties of a defense lawyer are those of a personal counselor and advocate[,]" who, although clearly an officer of the court, is not a state actor and, in performing the functions of a defense attorney, does not act under color of law within the meaning of 42 U.S.C. § 1983. Polk County v. Dodson, 454 U.S. 312, 318, 102 S.Ct. 445, 450, 70 L.Ed.2d 509, 516 (1981). Further, in Page v. Sharpe, 487 F.2d 567 (1st Cir.1973), a case similar to this, the First Circuit declared that "even under state courtappointments, the courts have uniformly held that an attorney, whether appointed or retained, is not acting under color of law." Id. at 570 (citing Szijarto v. Legeman, 466 F.2d 864 (9th Cir.1972); French v. Corrigan, 432 *458 F.2d 1211, 1214 (7th Cir.1970), cert. denied, 401 U.S. 915, 91 S.Ct. 890, 27 L.Ed.2d 814 (1971), and Mulligan v. Schlachter, 389 F.2d 231, 233 (6th Cir.1968)). In representing an accused, "a defense lawyer characteristically opposes the designated representatives of the State." Polk County, 454 U.S. at 318, 102 S.Ct. at 450, 70 L.Ed.2d at 516. As an advocate on behalf of his or her client, a defense attorney will best advance the public interest in the truth and fairness of our criminal justice system by adversarial testing of the state's case. Although state action is never implicated in the privately retained defense counsel relationship, the mere fact that counsel has been appointed by the tribunal to represent an indigent accused does not rise to the level of state action sufficient to invoke the provisions of 42 U.S.C. § 1983. The primary responsibility of a public defender or other court-appointed lawyer is to the accused and not to the administrative agency for which he or she is employed or the appointing authority. Further, a lawyer is bound by the Rules of Professional Conduct, including a responsibility to serve the client effectively and independently.[2] Thus, in the course of his or her representation of an indigent accused, a court-appointed attorney is not subject to the administrative control of the appointing authority and is obliged to exercise his or her skill and independent judgment on behalf of the client. Accordingly, in performing a lawyer's traditional functions as counsel to an indigent accused, a court-appointed attorney is not acting under color of state law. Thedefendant, therefore, does not come within the provisions of 42 U.S.C. § 1983 merely because he was plaintiff's court-appointed counsel. Thus, we are satisfied that the hearing justice properly dismissed the complaint for failure to meet a jurisdictional prerequisite of state action sufficient to invoke the provisions of 42 U.S.C. § 1983.
Furthermore, the hearing justice also found that because there was no averment that plaintiff's conviction had been vacated or reversed on appeal, the complaint failed to state a claim upon which relief can be granted. In the absence of a reversal or other vacation of plaintiff's conviction, Sollitto is not subject to suit by plaintiff. In response to an increasing number of collateral attacks on criminal prosecutions and mindful of the importance of finality and consistency in judicial proceedings, the United States Supreme Court in Heck v. Humphrey, 512 U.S. 477, 486-87, 114 S.Ct. 2364, 2372, 129 L.Ed.2d 383, 394 (1994), held that to qualify for money damages for an allegedly unconstitutional conviction, "a [42 U.S.C.] § 1983 plaintiff must prove that the conviction or sentence has been reversed on direct appeal, expunged by executive order, declared invalid by a state tribunal authorized to make such determination, or called into question by a federal court's issuance of a writ of habeas corpus."
Here, as in Heck, plaintiff is seeking monetary damages and not injunctive relief or a release from custody; nevertheless, his allegations, if proven, attack the legality of his conviction and imprisonment. We thus hold, that before a litigant may institute a 42 U.S.C. § 1983 claim for *459 alleged constitutional deprivations in connection with a criminal prosecution, the conviction must first be overturned on appeal or in collateral proceedings. Because the appeal of plaintiff's conviction is now presently pending, he has not met this threshold requirement. Accordingly, we are satisfied that the trial justice did not err in granting defendant's Rule 12(b)(6) motion to dismiss for failure to state a claim upon which relief can be granted.

II

Defendant's Attorney Malpractice Claim
The second claim in the complaint against Sollitto alleged negligence or attorney malpractice. To be successful in an action for attorney malpractice, "a plaintiff must prove by a fair preponderance of the evidence not only a defendant's duty of care, but also a breach thereof and the damages actually or proximately resulting therefrom to the plaintiff." Macera Brothers of Cranston, Inc. v. Gelfuso & Lachut, Inc., 740 A.2d 1262, 1264 (R.I.1999). Further, we have stated that "[f]ailure to prove all three of those required elements, acts as a matter of law, to bar relief or recovery." Id. (quoting Vallinoto v. DeSandro, 688 A.2d 830, 836 (R.I.1997)). As noted, plaintiff's conviction for first degree murder has yet to become final; "a judgment of conviction is not final as long as the case is pending on appeal." State v. Macarelli, 118 R.I. 693, 696, 375 A.2d 944, 946 (1977). In Heck, supra, the District Court dismissed the action without prejudice while petitioners' appeal to the Seventh Circuit was pending. Although this is clearly the appropriate remedy when a case is not ripe for suit, it is not the sole dispositive factor in the instant controversy. Other jurisdictions have held that a criminal defendant may not proceed in a legal malpractice action until and unless he can prove that he is innocent of the underlying charge and prove that, but for the attorney's negligence, plaintiff could not have been convicted of the crimes in question.[3] Clearly, the first step in making such a showing is at least an assertion in the pleading stage. Without such a claim, the plaintiff fails to properly assert the causation requirement for legal malpractice. Here, the failure of plaintiff's complaint to assert this causation requirement is fatal to his malpractice claim.
In Glenn v. Aiken, 569 N.E.2d 783, 788 (Mass. 1991), the Supreme Judicial Court of the Commonwealth of Massachusetts held that "in order to justify a right to recover, a plaintiff asserting an error of the type Glenn asserts in this case [failure to object to a faulty jury instruction] must prove by a preponderance of the evidence, not only that the negligence of the attorney defendant caused his harm, but also that he is innocent of the crime charged." The defendant urges us to adopt this heightened standard for malpractice claims against the criminal defense bar. However, because Laurence has failed to plead one of the basic requirements for a legal malpractice action and has failed to state a claim upon which relief can be granted, we need not reach the issue of whether a defendant *460 must prove his innocence in cases alleging malpractice committed in the course of his criminal defense.
Furthermore, we are not satisfied that the complaint sets forth even a threshold showing of negligence on the part of this well-respected attorney. The defendant's representation of the plaintiff was brief and was limited to a hearing on a pretrial motion to suppress. During the trial on the central question of Laurence's guilt or innocence, the defendant represented himself. We are hard-pressed to conclude that the defendant's conviction rested solely on the purported negligence of an attorney whose engagement was limited to a pretrial suppression hearing held months before the jury trial began. The Superior Court justice, therefore, properly granted the defendant's motion to dismiss for failure to state a justiciable claim.

Conclusion
For the reasons included herein, the plaintiff's appeal is denied and dismissed and the judgment of the Superior Court is affirmed. The papers in this case are remanded to the Superior Court.
Chief Justice Williams did not participate.
NOTES
[1]  42 U.S.C. § 1983 provides in pertinent part:

"Every person who, under color of any statute, ordinance, regulation, custom, or usage, of any State or Territory or the District of Columbia subjects, or causes to be subjected, any citizen of the United States or other person within the jurisdiction thereof to the deprivation of any rights, privileges, or immunities secured by the Constitution and laws, shall be liable to the party injured in an action at law, suit in equity, or other proper proceeding for redress * * *."
[2]  Article V, Rule 1, "Client-Lawyer Relationship" and Rule 2, "Counselor" of the Supreme Court Rules of Professional Conduct, provide in relevant part as follows:

"Rule 1.1 Competence. A Lawyer shall provide competent representation to a client. Competent representation requires the legal knowledge, skill, thoroughness and preparation reasonably necessary for the representation."
"Rule 2.1 Advisor. In representing a client, a lawyer shall exercise independent professional judgment and render candid advice."
[3]  See, e.g., Streeter v. Young, 583 So. 2d 1339 (Ala.1991); Shaw v. State Department of Administration, 816 P.2d 1358 (Alaska 1991); Steele v. Kehoe, 747 So.2d 931 (Fla.1999); Glenn v. Aiken, 409 Mass. 699, 569 N.E.2d 783 (1991); Rodriguez v. Nielsen, 259 Neb. 264, 609 N.W.2d 368 (2000); Morgano v. Smith, 110 Nev. 1025, 879 P.2d 735 (1994); Carmel v. Lunney, 70 N.Y.2d 169, 518 N.Y.S.2d 605, 511 N.E.2d 1126 (1987); Stevens v. Bispham, 316 Or. 221, 851 P.2d 556 (1993); Bailey v. Tucker, 533 Pa. 237, 621 A.2d 108 (1993); Peeler v. Hughes & Luce, 868 S.W.2d 823 (Tex.App.1993), aff'd, 909 S.W.2d 494 (Tex.1995).
