Shramkoweb/Portfolio

View on GitHub

Showing 89 of 89 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            <Link
              href="/about"
              className="mt-8 mb-8 flex h-6 items-center rounded-lg leading-7 text-gray-600 transition-all hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200"
            >
              Read more about me
Severity: Major
Found in pages/index.tsx and 1 other location - About 2 hrs to fix
pages/index.tsx on lines 181..200

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 90.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        <Link
          href="/blog"
          className="mt-8 flex h-6 items-center rounded-lg leading-10 text-gray-600 transition-all hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200"
        >
          Read more posts
Severity: Major
Found in pages/index.tsx and 1 other location - About 2 hrs to fix
pages/index.tsx on lines 90..109

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 90.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File index.tsx has 278 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Head from 'next/head';
import Image from 'next/image';
import Link from 'next/link';

import firstImage from '../../public/static/images/quizlet-list/quizlet-quicklist-1.png';
Severity: Minor
Found in pages/quizlet-list/index.tsx - About 2 hrs to fix

    Function PostReaction has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function PostReaction() {
      const { state, actions } = useFeedbackReducer();
      const isReactionUntouched = state.feedback === Feedback.Blank;
    
      const handleYesClick = () => {
    Severity: Major
    Found in components/post-reaction/post-reaction.tsx - About 2 hrs to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export async function getStaticPaths(): Promise<GetStaticPathsResult<Params>> {
        const slugs = await getPostSlugs();
      
        return {
          paths: slugs.map((slug: string) => ({
      Severity: Major
      Found in pages/blog/[slug].tsx and 1 other location - About 2 hrs to fix
      pages/snippets/[slug].tsx on lines 132..143

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 83.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      export async function getStaticPaths(): Promise<GetStaticPathsResult<Params>> {
        const slugs = await getSnippetSlugs();
      
        return {
          paths: slugs.map((slug: string) => ({
      Severity: Major
      Found in pages/snippets/[slug].tsx and 1 other location - About 2 hrs to fix
      pages/blog/[slug].tsx on lines 239..250

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 83.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function Dashboard has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function Dashboard() {
        return (
          <>
            <Head>
              <title>Dashboard | Serhii Shramko</title>
      Severity: Major
      Found in pages/dashboard.tsx - About 2 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export async function getSnippets(): Promise<Snippet[]> {
          const fileNames = await readdir(SNIPPETS_DIRECTORY);
        
          return Promise.all(
            fileNames.map((fileName) => {
        Severity: Major
        Found in lib/snippets/api.ts and 1 other location - About 2 hrs to fix
        lib/posts/api.ts on lines 55..65

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 81.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

        export async function getPosts(): Promise<Post[]> {
          const fileNames = await readdir(POSTS_DIRECTORY);
        
          return Promise.all(
            fileNames.map((fileName) => {
        Severity: Major
        Found in lib/posts/api.ts and 1 other location - About 2 hrs to fix
        lib/snippets/api.ts on lines 43..53

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 81.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          return (
            <ShareButton onClick={handleClick} ariaLabel="Share this post on LinkedIn">
              <svg
                className="w-[18px]"
                viewBox="0 0 256 256"
        Severity: Major
        Found in components/share-button/linkedin-share.tsx and 1 other location - About 2 hrs to fix
        components/share-button/twitter-share.tsx on lines 12..26

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 77.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          return (
            <ShareButton onClick={handleClick} ariaLabel="Share this post on Twitter">
              <svg
                className="w-[18px]"
                viewBox="0 0 256 209"
        Severity: Major
        Found in components/share-button/twitter-share.tsx and 1 other location - About 2 hrs to fix
        components/share-button/linkedin-share.tsx on lines 12..26

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 77.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function SnippetsPage has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function SnippetsPage(props: SnippetsPageProps) {
          const { snippets } = props;
        
          return (
            <>
        Severity: Major
        Found in pages/snippets/index.tsx - About 2 hrs to fix

          Function Document has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function Document() {
            const { serverRuntimeConfig } = getConfig();
          
            return (
              <Html lang="en" data-relese={serverRuntimeConfig.appReleaseVersion}>
          Severity: Minor
          Found in pages/_document.tsx - About 1 hr to fix

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            export function GithubFollowers() {
              const { data } = useSWR<GitHub>('/api/github', fetcher);
            
              const followers = data?.followers;
            
            
            Severity: Major
            Found in components/dashboard-card/github-followers.tsx and 2 other locations - About 1 hr to fix
            components/dashboard-card/blog-views.tsx on lines 8..20
            components/dashboard-card/github-stars.tsx on lines 8..20

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 72.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            export function GitHubStars() {
              const { data } = useSWR<GitHub>('/api/github', fetcher);
            
              const stars = data?.stars;
            
            
            Severity: Major
            Found in components/dashboard-card/github-stars.tsx and 2 other locations - About 1 hr to fix
            components/dashboard-card/blog-views.tsx on lines 8..20
            components/dashboard-card/github-followers.tsx on lines 8..20

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 72.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            export function BlogViewsCard() {
              const { data } = useSWR<Views>('/api/views', fetcher);
            
              const blogViews = data?.total;
            
            
            Severity: Major
            Found in components/dashboard-card/blog-views.tsx and 2 other locations - About 1 hr to fix
            components/dashboard-card/github-followers.tsx on lines 8..20
            components/dashboard-card/github-stars.tsx on lines 8..20

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 72.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Function BlogPostSquarePreview has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function BlogPostSquarePreview(props: BlogPostPreviewProps) {
              const { heading, slug, classNames } = props;
            
              const { data } = useSWR<Views>(`/api/views/${slug}`, fetcher);
              const views = data?.total;
            Severity: Minor
            Found in components/blog-post-square-preview/blog-post-square-preview.tsx - About 1 hr to fix

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    <Head>
                      <title>Dashboard | Serhii Shramko</title>
                      <meta
                        content="My dashboard is built using Next.js API routes as serverless functions. It's personalized and easy to access."
                        name="description"
              Severity: Major
              Found in pages/dashboard.tsx and 1 other location - About 1 hr to fix
              pages/gear.tsx on lines 9..25

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 71.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    <Head>
                      <title>Gear | Serhii Shramko</title>
                      <meta
                        content="Here's what gear I'm currently using for coding and live."
                        name="description"
              Severity: Major
              Found in pages/gear.tsx and 1 other location - About 1 hr to fix
              pages/dashboard.tsx on lines 11..30

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 71.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function ThemeChanger has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function ThemeChanger() {
                const [mounted, setMounted] = useState(false);
                const { resolvedTheme, setTheme } = useTheme();
              
                useEffect(() => setMounted(true), []);
              Severity: Minor
              Found in components/theme-changer/theme-changer.tsx - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language