mavend/octoboard

View on GitHub

Showing 21 of 44 total issues

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

        <ul>
          <li>the purposes of the processing;</li>
          <li>the categories of personal data concerned;</li>
          <li>
            the recipients or categories of recipients to whom the personal data have been or will
Severity: Major
Found in src/views/policy/Content.js and 1 other location - About 3 hrs to fix
src/views/policy/Content.js on lines 1026..1054

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 116.

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

        <ul>
          <li>cele przetwarzania;</li>
          <li>kategorie danych osobowych, które są przetwarzane;</li>
          <li>
            informacje o odbiorcach lub kategoriach odbiorców, którym dane osobowe zostały lub
Severity: Major
Found in src/views/policy/Content.js and 1 other location - About 3 hrs to fix
src/views/policy/Content.js on lines 302..330

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 116.

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 Board has a Cognitive Complexity of 28 (exceeds 10 allowed). Consider refactoring.
Open

const Board = () => {
  const { G, ctx, moves, players, player, playerID } = useBoardGame();
  const [selectedCard, setSelectedCard] = useState(null);
  const [availableBonuses, setAvailableBonuses] = useState(null);
  const [loading, setLoading] = useState(null);
Severity: Minor
Found in src/games/splendid/Board/index.js - About 3 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

        {isYou && (
          <Button
            style={{ marginTop: 10 }}
            basic
            color={notificationsEnabled ? "green" : "grey"}
Severity: Major
Found in src/games/scrambled/Board/GameBoard.js and 1 other location - About 3 hrs to fix
src/games/kalambury/Board/index.js on lines 108..121

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 112.

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

      isYou && (
        <Button
          style={{ marginTop: 10 }}
          basic
          color={soundsEnabled ? "green" : "grey"}
Severity: Major
Found in src/games/kalambury/Board/index.js and 1 other location - About 3 hrs to fix
src/games/scrambled/Board/GameBoard.js on lines 222..235

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 112.

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 Board has a Cognitive Complexity of 26 (exceeds 10 allowed). Consider refactoring.
Open

const Board = () => {
  const {
    G,
    ctx: { phase, gameover },
    players,
Severity: Minor
Found in src/games/kalambury/Board/index.js - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function Board has 195 lines of code (exceeds 150 allowed). Consider refactoring.
Open

const Board = () => {
  const { G, ctx, moves, players, player, playerID } = useBoardGame();
  const [selectedCard, setSelectedCard] = useState(null);
  const [availableBonuses, setAvailableBonuses] = useState(null);
  const [loading, setLoading] = useState(null);
Severity: Major
Found in src/games/splendid/Board/index.js - About 2 hrs to fix

    Function TokensShop has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.
    Open

    const TokensShop = ({ tokens, active, loading, onTakeTokens, playerTokensCount }) => {
      const [selected, setSelected] = useState({ ...emptyTokens });
    
      const tooMuchTokens = sum(Object.values(selected)) + playerTokensCount >= 10;
    
    
    Severity: Minor
    Found in src/games/splendid/Board/TokensShop.js - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Consider simplifying this complex logical expression.
    Open

            if (user && user.displayName) {
              return <Redirect to={from || routes.lobby()} />;
            } else {
              return (
                <>
    Severity: Major
    Found in src/utils/router/NotLoggedInRoute.js - About 1 hr to fix

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

            <li>
              <h3 id="h-automated-individual-decision-making-including-profiling">
                h) Automated individual decision-making, including profiling
              </h3>
              <p>
      Severity: Minor
      Found in src/views/policy/Content.js and 1 other location - About 55 mins to fix
      src/views/policy/Content.js on lines 440..464

      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 69.

      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

            <li>
              <h3 id="f-right-to-data-portability">f) Right to data portability</h3>
              <p>
                Each data subject shall have the right granted by the European legislator, to receive the
                personal data concerning him or her, which was provided to a controller, in a structured,
      Severity: Minor
      Found in src/views/policy/Content.js and 1 other location - About 55 mins to fix
      src/views/policy/Content.js on lines 501..527

      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 69.

      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 StartGame has 7 arguments (exceeds 5 allowed). Consider refactoring.
      Open

      function StartGame(G, ctx, gameMode, maxPoints, language, category, timePerTurn) {
      Severity: Major
      Found in src/games/kalambury/Game.js - About 45 mins to fix

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

                <ul>
                  <li>
                    The accuracy of the personal data is contested by the data subject, for a period
                    enabling the controller to verify the accuracy of the personal data.
                  </li>
        Severity: Major
        Found in src/views/policy/Content.js and 3 other locations - About 40 mins to fix
        src/views/policy/Content.js on lines 1145..1163
        src/views/policy/Content.js on lines 1171..1197
        src/views/policy/Content.js on lines 1242..1272

        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 64.

        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 4 locations. Consider refactoring.
        Open

              <li>
                <h4>f) Prawo do przenoszenia danych. </h4>
                <p>
                  Każda osoba, której dane osobowe są przetwarzane, ma przyznane jej przez ustawodawcę Unii
                  Europejskiej prawo otrzymać w ustrukturyzowanym, powszechnie używanym formacie nadającym
        Severity: Major
        Found in src/views/policy/Content.js and 3 other locations - About 40 mins to fix
        src/views/policy/Content.js on lines 413..432
        src/views/policy/Content.js on lines 1145..1163
        src/views/policy/Content.js on lines 1242..1272

        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 64.

        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 4 locations. Consider refactoring.
        Open

                <ul>
                  <li>
                    kwestionuje się prawidłowość danych osobowych przez osobę, której dane dotyczą - na
                    okres pozwalający administratorowi sprawdzić prawidłowość tych danych;
                  </li>
        Severity: Major
        Found in src/views/policy/Content.js and 3 other locations - About 40 mins to fix
        src/views/policy/Content.js on lines 413..432
        src/views/policy/Content.js on lines 1171..1197
        src/views/policy/Content.js on lines 1242..1272

        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 64.

        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 4 locations. Consider refactoring.
        Open

              <li>
                <h4>
                  h) Zautomatyzowane podejmowanie decyzji w indywidualnych przypadkach, w tym profilowanie.
                </h4>
                <p>
        Severity: Major
        Found in src/views/policy/Content.js and 3 other locations - About 40 mins to fix
        src/views/policy/Content.js on lines 413..432
        src/views/policy/Content.js on lines 1145..1163
        src/views/policy/Content.js on lines 1171..1197

        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 64.

        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 leaveGame has 6 arguments (exceeds 5 allowed). Consider refactoring.
        Open

        function leaveGame(gameName, matchID, playerID, playerUID, credentials, history) {
        Severity: Minor
        Found in src/utils/game/leave.js - About 35 mins to fix

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

            {
              points: [
                [0.5261584454409567, 0.22861469678385235],
                [0.5261584454409567, 0.22861469678385235],
                [0.5249626307922272, 0.23339798703202055],
          Severity: Minor
          Found in src/games/kalambury/data/stories/lines.js and 1 other location - About 35 mins to fix
          src/games/kalambury/data/stories/lines.js on lines 35..51

          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 62.

          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

            {
              points: [
                [0.33482810164424515, 0.45183490836503576],
                [0.33602391629297457, 0.45183490836503576],
                [0.33841554559043346, 0.45183490836503576],
          Severity: Minor
          Found in src/games/kalambury/data/stories/lines.js and 1 other location - About 35 mins to fix
          src/games/kalambury/data/stories/lines.js on lines 18..34

          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 62.

          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 FilterBox has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
          Open

          const FilterBox = ({ games, filters, onChange }) => {
            const { t } = useTranslation("lobby");
            const [open, setOpen] = useState(false);
            const searchRef = useRef();
          
          
          Severity: Minor
          Found in src/components/lobby/FilterBox.js - About 25 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Severity
          Category
          Status
          Source
          Language