Halacha

הלכה א
הָרְשָׁעִים פְּסוּלִין לְעֵדוּת מִן הַתּוֹרָה שֶׁנֶּאֱמַר (שמות כג א) "אַל תָּשֶׁת יָדְךָ עִם רָשָׁע לִהְיֹת עֵד חָמָס" מִפִּי הַשְּׁמוּעָה לָמְדוּ אַל תָּשֶׁת רָשָׁע עֵד. וַאֲפִלּוּ עֵד כָּשֵׁר שֶׁיּוֹדֵעַ בַּחֲבֵרוֹ שֶׁהוּא רָשָׁע וְאֵין הַדַּיָּנִים מַכִּירִין רִשְׁעוֹ אָסוּר לוֹ לְהָעִיד עִמּוֹ אַף עַל פִּי שֶׁהוּא עֵדוּת אֱמֶת. מִפְּנֵי שֶׁמִּצְטָרֵף עִמּוֹ וְנִמְצָא זֶה הַכָּשֵׁר הֵשִׁית יָדוֹ עִם הָרָשָׁע עַד שֶׁנִּתְקַבְּלָה עֵדוּתוֹ. וְאֵין צָרִיךְ לוֹמַר עֵד כָּשֵׁר שֶׁהוּא יוֹדֵעַ בְּעֵדוּת לַחֲבֵרוֹ וְיָדַע שֶׁהָעֵד הַשֵּׁנִי עִמּוֹ עֵד שֶׁקֶר שֶׁאָסוּר לוֹ לְהָעִיד שֶׁנֶּאֱמַר אַל תָּשֶׁת יָדְךָ עִם רָשָׁע:
כסף משנה
1.
The wicked are unacceptable as witnesses according to Scriptural Law, as Exodus 23:1 states: "Do not join hands with a wicked person to be a corrupt witness." The Oral Tradition interprets this as meaning: "Do not allow a wicked person to serve as a witness."
Even when an acceptable witness knows that his colleague is "wicked," but the judges are unaware of his wickedness, it is forbidden for him to offer testimony together with him even though he knows that the testimony is true, for, by doing so, he is joining together with him. Thus the acceptable witness "joined hands" with the wicked person, enabling his testimony to be accepted. Needless to say, it is forbidden for an acceptable witness who knows testimony concerning a colleague to testify when he knows that the other witness who testifies with him is giving false testimony. This is also implied by the verse: "Do not join hands with a wicked person."

הלכה ב
אֵי זֶהוּ רָשָׁע כָּל שֶׁעָבַר עֲבֵרָה שֶׁחַיָּבִין עָלֶיהָ מַלְקוֹת זֶהוּ רָשָׁע וּפָסוּל. שֶׁהֲרֵי הַתּוֹרָה קָרְאָה לַמְחֻיָּב מַלְקוֹת רָשָׁע שֶׁנֶּאֱמַר (דברים כה ב) "וְהָיָה אִם בִּן הַכּוֹת הָרָשָׁע". וְאֵין צָרִיךְ לוֹמַר מְחֻיָּב מִיתַת בֵּית דִּין שֶׁהוּא פָּסוּל שֶׁנֶּאֱמַר (במדבר לה לא) "אֲשֶׁר הוּא רָשָׁע לָמוּת":
כסף משנה
2.
What is meant by "a wicked person"? Anyone who violates a prohibition punishable by lashes is considered wicked and is unacceptable as a witness. For the Torah referred to a person obligated to receive lashes with the term "wicked," as Deuteronomy 25:2 states: "If the wicked person is liable to be beaten." Needless to say, a person who is obligated to be executed by the court is unacceptable, for Numbers 35:31 states: "He is a wicked person who is sentenced to die."

הלכה ג
עָבַר עֲבֵרָה שֶׁחַיָּבִין עָלֶיהָ מַלְקוֹת מִן הַתּוֹרָה הֲרֵי זֶה פָּסוּל מִן הַתּוֹרָה. וְאִם הָיָה הַחִיּוּב שֶׁבָּהּ מִדִּבְרֵיהֶם הֲרֵי זֶה פָּסוּל מִדִּבְרֵיהֶם. כֵּיצַד. אָכַל בְּשַׂר בְּהֵמָה בְּחָלָב אוֹ שֶׁאָכַל נְבֵלוֹת וּשְׁקָצִים וְכַיּוֹצֵא בָּהֶן בֵּין לְתֵאָבוֹן בֵּין לְהַכְעִיס. אוֹ שֶׁחִלֵּל אֶת יוֹם טוֹב הָרִאשׁוֹן. אוֹ שֶׁלָּבַשׁ שַׁעַטְנֵז שֶׁהוּא שׁוּעַ אוֹ טָווּי אוֹ נוּז. הֲרֵי זֶה פָּסוּל לְעֵדוּת מִן הַתּוֹרָה. אֲבָל אִם אָכַל בְּשַׂר עוֹף בְּחָלָב. אוֹ שֶׁחִלֵּל יוֹם טוֹב שֵׁנִי שֶׁל גָּלֻיּוֹת. אוֹ שֶׁלָּבַשׁ בֶּגֶד צֶמֶר שֶׁאָבַד בּוֹ חוּט שֶׁל פִּשְׁתָּן וְכַיּוֹצֵא בּוֹ. הֲרֵי הוּא פָּסוּל מִדִּבְרֵיהֶם. וּכְבָר מָנִינוּ כָּל עֲבֵרָה שֶׁחַיָּבִין עָלֶיהָ מַלְקוֹת. וּכְבָר נִתְבָּאֵר בְּכָל מִצְוָה וּמִצְוָה דְּבָרִים שֶׁאֲסוּרִים מִן הַתּוֹרָה וּדְבָרִים שֶׁאֲסוּרִין מִדִּבְרֵיהֶם:
כסף משנה
3.
When a person commits a transgression for which he is liable to receive lashes according to Scriptural Law, he is disqualified as a witness according to Scriptural Law. When the prohibition is Rabbinical in origin, he is disqualified by Rabbinic decree.
What is implied? A person who ate the meat of an animal cooked in milk, carrion, a teeming animal, or the like is not acceptable as a witness according to Scriptural Law. This applies whether he transgressed because of appetite or with the intent of angering God. The same law also applies if he desecrates the sanctity of the first day of a festival or wears a garment that is shaatnez, i.e., combed, spun, or woven with wool and linen. If he eat the meat of fowl cooked in milk, he desecrated the second day of a festival observed in the diaspora, or wore a woolen garment in which a strand of linen was lost or the like, he is disqualified by Rabbinic decree. We have already enumerated all the transgressions for which one is punished by lashes. And with regard to each and every mitzvah, we have already explained which matters are forbidden by Scriptural Law and which are forbidden by Rabbinic decree.

הלכה ד
וְעוֹד יֵשׁ שָׁם רְשָׁעִים שֶׁהֵן פְּסוּלִין לְעֵדוּת אַף עַל פִּי שֶׁהֵן בְּנֵי תַּשְׁלוּמִין וְאֵינָן בְּנֵי מַלְקוֹת. הוֹאִיל וְלוֹקְחִים מָמוֹן שֶׁאֵינוֹ שֶׁלָּהֶם בְּחָמָס פְּסוּלִין שֶׁנֶּאֱמַר (דברים יט טז) "כִּי יָקוּם עֵד חָמָס בְּאִישׁ". כְּגוֹן הַגַּנָּבִים וְהַחַמְסָנִים אַף עַל פִּי שֶׁהֶחְזִיר פָּסוּל לְעֵדוּת מֵעֵת שֶׁגָּנַב אוֹ גָּזַל. וְכֵן עֵד זוֹמֵם אַף עַל פִּי שֶׁהוּזַם בְּעֵדוּת מָמוֹן וְשִׁלֵּם הֲרֵי זֶה פָּסוּל מִן הַתּוֹרָה לְכָל עֵדוּת. וּמֵאֵימָתַי הוּא נִפְסָל מֵעֵת שֶׁהֵעִיד בְּבֵית דִּין. אַף עַל פִּי שֶׁלֹּא הוּזַם עַל אוֹתָהּ עֵדוּת אֶלָּא אַחַר כַּמָּה יָמִים. וְכֵן הַמַּלְוֶה בְּרִבִּית אֶחָד הַמַּלְוֶה וְאֶחָד הַלּוֶֹה שְׁנֵיהֶם פְּסוּלִין לְעֵדוּת. אִם רִבִּית קְצוּצָה עָשׂוּ הֲרֵי הֵן פְּסוּלִין מִן הַתּוֹרָה וְאִם אֲבַק רִבִּית עָשׂוּ הֲרֵי הֵן פְּסוּלִין מִדִּבְרֵיהֶם. וְכֵן כָּל הָעוֹבֵר עַל גֵּזֶל שֶׁל דִּבְרֵיהֶם הֲרֵי הוּא פָּסוּל מִדִּבְרֵיהֶם. כֵּיצַד. הַחַמְסָנִים וְהֵם הַלּוֹקְחִים קַרְקַע אוֹ מִטַּלְטְלִין שֶׁלֹּא בִּרְצוֹן הַבְּעָלִים אַף עַל פִּי שֶּׁנּוֹתְנִין הַדָּמִים הֲרֵי אֵלּוּ פְּסוּלִין מִדִּבְרֵיהֶם. וְכֵן הָרוֹעִים אֶחָד רוֹעֵי בְּהֵמָה דַּקָּה וְאֶחָד רוֹעֵי בְּהֵמָה גַּסָּה שֶׁל עַצְמָן הֲרֵי הֵן פְּסוּלִין שֶׁחֶזְקָתָן פּוֹשְׁטִין יְדֵיהֶן בְּגֵזֶל וּמְנִיחִים בְּהֶמְתָּן לִרְעוֹת בְּשָׂדוֹת וּפַרְדֵּסִים שֶׁל אֲחֵרִים וּלְפִיכָךְ סְתָם רוֹעֶה פָּסוּל. וּמְגַדְּלֵי בְּהֵמָה דַּקָּה בְּאֶרֶץ יִשְׂרָאֵל פְּסוּלִין אֲבָל בְּחוּצָה לָאָרֶץ כְּשֵׁרִין. וּמֻתָּר לְגַדֵּל בְּהֵמָה גַּסָּה בְּכָל מָקוֹם. וְכֵן הַמּוֹכְסִין סְתָמָן פְּסוּלִין מִפְּנֵי שֶׁחֶזְקָתָן לִקַּח יוֹתֵר מִדָּבָר הַקָּצוּב לָהֶם בְּדִין הַמַּלְכוּת וְלוֹקְחִין הֶתֵּר לְעַצְמָן. אֲבָל גַּבָּאֵי מְנַת הַמֶּלֶךְ סְתָמָן כְּשֵׁרִין וְאִם נוֹדַע שֶׁלָּקְחוּ אֲפִלּוּ פַּעַם אַחַת יֶתֶר מִן הָרָאוּי לָהֶם לִגְבּוֹת הֲרֵי אֵלּוּ פְּסוּלִין. וְכֵן מַפְרִיחֵי יוֹנִים בַּיִּשּׁוּב פְּסוּלִין מִפְּנֵי שֶׁחֶזְקָתָן שֶׁגּוֹזְלִים יוֹנִים שֶׁל אֲחֵרִים בְּחִנָּם. וְכֵן סוֹחֲרֵי שְׁבִיעִית וְהֵם בְּנֵי אָדָם שֶׁיּוֹשְׁבִין בְּטֵלִים וְכֵיוָן שֶׁבָּאָה שְׁבִיעִית פּוֹשְׁטִים יְדֵיהֶן וּמַתְחִילִין לִשָּׂא וְלִתֵּן בְּפֵרוֹת שֶׁחֶזְקַת אֵלּוּ שֶׁהֵן אוֹסְפִין פֵּרוֹת שְׁבִיעִית וְעוֹשִׂין בָּהֶן סְחוֹרָה. וְכֵן מְשַׂחֵק בְּקֻבִּיָּא וְהוּא שֶׁלֹּא תִּהְיֶה לוֹ אֻמָּנוּת אֶלָּא הוּא. הוֹאִיל וְאֵינוֹ עוֹסֵק בְּיִשּׁוּבוֹ שֶׁל עוֹלָם הֲרֵי זֶה בְּחֶזְקַת שֶׁאוֹכֵל מִן הַקֻּבִּיָּא שֶׁהוּא אֲבַק גֵּזֶל. וְלֹא בְּקֻבִּיָּא בִּלְבַד אֶלָּא אֲפִלּוּ מְשַׂחֲקִים בִּקְלִפֵּי אֱגוֹזִים וּקְלִפֵּי רִמּוֹנִים. וְכֵן לֹא יוֹנִים בִּלְבַד אָמְרוּ אֶלָּא אֲפִלּוּ הַמְשַׂחֲקִים בִּבְהֵמָה חַיָּה וְעוֹף וְאוֹמֵר כָּל הַקּוֹדֵם אֶת חֲבֵרוֹ אוֹ כָּל הַנּוֹצֵחַ אֶת חֲבֵרוֹ יִטּל בְּעָלָיו אֶת שְׁנֵיהֶן. וְכֵן כָּל כַּיּוֹצֵא בִּשְׂחוֹק זֶה. וְהוּא שֶׁלֹּא תִּהְיֶה לוֹ אֻמָּנוּת אֶלָּא שְׂחוֹק זֶה הֲרֵי הוּא פָּסוּל. וְכָל אֵלּוּ פְּסוּלִין מִדִּבְרֵיהֶם:
כסף משנה
4.
There are other wicked persons who are not acceptable as witnesses even though they are required to make financial restitution and are not punished by lashes. Since they take money that does not belong to them lawlessly, they are unacceptable, as Deuteronomy 19:16 states: "When a lawless witness rises up against a person...." For example, thieves and people who seize property, even though they make restitution, they are no longer acceptable as witnesses from the time they stole or robbed onward.
Similarly, a lying witness, even though his testimony was disproved with regard to financial matters and he made restitution, he is still unacceptable as a witness according to Scriptural Law for all matters. From when is he disqualified? From the time he testified falsely in court, even though his testimony was not disproved until several days later.
Similarly, when people are involved with loans at interest - both the borrower and the lender - if fixed interest is involved, both are disqualified according to Scriptural Law. If the shade of interest is involved, they are both disqualified by Rabbinic decree. Similarly, a person who transgresses the Rabbinic decrees against theft is disqualified by Rabbinic decree.
What is implied? People who seize property - either landed property or movable property - without the consent of the owners, even though they pay its worth, are disqualified by Rabbinic decree. Similarly, herders of their own animals - both of small animals and of large animals - are disqualified, for it can be assumed that they take liberty and steal by allowing their animals to pasture in fields and orchards belonging to other people. Therefore, an ordinary herder is disqualified.
People who raise small animals in Eretz Yisrael are not acceptable as witnesses. In the diaspora, by contrast, they are acceptable. It is permissible to raise a large animal in every place.
Generally, the collectors of the king's duty are not acceptable, because it is assumed that they will collect more than what is required by the king's decree and keep the extra portion for themselves. Tax collectors, by contrast, are generally considered to be acceptable. If, however, it is known that they took more than is required to collect, even once, they are disqualified.
Similarly, those who guide the flight of doves in a settled area are disqualified, because we assume that they will steal doves belonging to others without paying for them. This ruling also applies to merchants of produce in the Sabbatical year, i.e., people who generally are idle but when the Sabbatical year arrives, they begin to do business with produce. It can be assumed that they collect the produce of the Sabbatical year and do business with it.
Similarly, dice-players are disqualified if this is their only occupation. Since such a person does not involve himself in ordinary business pursuits, it can be assumed that his livelihood is dependent on his gambling, which is forbidden as "the shade of robbery." The above applies not only to dice-players, but also to all those who gamble with the shells of nuts or the shells of pomegranates. Similarly, our Sages did not disqualify only those who train doves, but also those who gamble with other animals, beasts, and fowl, saying the owner of the one that will outrace the other or vanquish the other will acquire the stakes put up by both. Similarly, other analogous types of gamblers are disqualified, provided they do not derive their livelihood from a source other than gambling. All of the above are disqualified according to Rabbinic decree.

הלכה ה
אָרִיס שֶׁלָּקַח דָּבָר מוּעָט מִן הַפֵּרוֹת שֶׁבִּכְּרוּ בִּימֵי נִיסָן וִימֵי תִּשְׁרֵי קֹדֶם שֶׁתִּגָּמֵר מְלַאכְתָּן. אַף עַל פִּי שֶׁלָּקַח שֶׁלֹּא מִדַּעַת בַּעַל הַשָּׂדֶה אֵינוֹ גַּנָּב וְכָשֵׁר לְעֵדוּת. שֶׁאֵין בַּעַל הַשָּׂדֶה מַקְפִּיד עָלָיו. וְכֵן כָּל כַּיּוֹצֵא בָּזֶה:
כסף משנה
5.
The fact that a sharecropper takes a small amount of the produce which sprouts in Nisan and in Tishrei before the harvest is finished without the knowledge of the owner of the field does not cause him to be considered as a thief and he is acceptable as a witness. The rationale is that the owner of the field is not concerned with such a small quantity of produce. Similar principles apply in all analogous situations.

שופטים הלכות עדות פרק י
Shoftim Edus Chapter 10