WordPress/WordPress

View on GitHub
wp-includes/sodium_compat/src/Core/Curve25519.php

Summary

Maintainability
F
1 mo
Test Coverage

File Curve25519.php has 2654 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

if (class_exists('ParagonIE_Sodium_Core_Curve25519', false)) {
    return;
}
Severity: Major
Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 wk to fix

    Method sc_muladd has 410 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function sc_muladd($a, $b, $c)
        {
            $a0 = 2097151 & self::load_3(self::substr($a, 0, 3));
            $a1 = 2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5);
            $a2 = 2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2);
    Severity: Major
    Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 2 days to fix

      Method sc25519_mul has 399 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function sc25519_mul($a, $b)
          {
              //    int64_t a0  = 2097151 & load_3(a);
              //    int64_t a1  = 2097151 & (load_4(a + 2) >> 5);
              //    int64_t a2  = 2097151 & (load_3(a + 5) >> 2);
      Severity: Major
      Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 day to fix

        Method sc_reduce has 283 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function sc_reduce($s)
            {
                $s0 = 2097151 & self::load_3(self::substr($s, 0, 3));
                $s1 = 2097151 & (self::load_4(self::substr($s, 2, 4)) >> 5);
                $s2 = 2097151 & (self::load_3(self::substr($s, 5, 3)) >> 2);
        Severity: Major
        Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 day to fix

          Method fe_mul has 198 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function fe_mul(
                  ParagonIE_Sodium_Core_Curve25519_Fe $f,
                  ParagonIE_Sodium_Core_Curve25519_Fe $g
              ) {
                  // Ensure limbs aren't oversized.
          Severity: Major
          Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 7 hrs to fix

            ParagonIE_Sodium_Core_Curve25519 has 51 functions (exceeds 20 allowed). Consider refactoring.
            Open

            abstract class ParagonIE_Sodium_Core_Curve25519 extends ParagonIE_Sodium_Core_Curve25519_H
            {
                /**
                 * Get a field element of size 10 with a value of 0
                 *
            Severity: Major
            Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 7 hrs to fix

              Method fe_sq has 141 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function fe_sq(ParagonIE_Sodium_Core_Curve25519_Fe $f)
                  {
                      $f = self::fe_normalize($f);
                      $f0 = (int) $f[0];
                      $f1 = (int) $f[1];
              Severity: Major
              Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 5 hrs to fix

                Function slide has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function slide($a)
                    {
                        if (self::strlen($a) < 256) {
                            if (self::strlen($a) < 16) {
                                $a = str_pad($a, 256, '0', STR_PAD_RIGHT);
                Severity: Minor
                Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 5 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

                Method fe_sq2 has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function fe_sq2(ParagonIE_Sodium_Core_Curve25519_Fe $f)
                    {
                        $f = self::fe_normalize($f);
                        $f0 = (int) $f[0];
                        $f1 = (int) $f[1];
                Severity: Major
                Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 5 hrs to fix

                  Method ge_double_scalarmult_vartime has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function ge_double_scalarmult_vartime(
                          $a,
                          ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A,
                          $b
                      ) {
                  Severity: Major
                  Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 3 hrs to fix

                    Method fe_pow22523 has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function fe_pow22523(ParagonIE_Sodium_Core_Curve25519_Fe $z)
                        {
                            $z = self::fe_normalize($z);
                            # fe_sq(t0, z);
                            # fe_sq(t1, t0);
                    Severity: Major
                    Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 3 hrs to fix

                      Method fe_tobytes has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function fe_tobytes(ParagonIE_Sodium_Core_Curve25519_Fe $h)
                          {
                              $h0 = (int) $h[0];
                              $h1 = (int) $h[1];
                              $h2 = (int) $h[2];
                      Severity: Major
                      Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 3 hrs to fix

                        Method fe_frombytes has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function fe_frombytes($s)
                            {
                                if (self::strlen($s) !== 32) {
                                    throw new RangeException('Expected a 32-byte string.');
                                }
                        Severity: Major
                        Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 2 hrs to fix

                          Function ge_double_scalarmult_vartime has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function ge_double_scalarmult_vartime(
                                  $a,
                                  ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A,
                                  $b
                              ) {
                          Severity: Minor
                          Found in wp-includes/sodium_compat/src/Core/Curve25519.php - 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

                          Method ge_scalarmult has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function ge_scalarmult($a, $p)
                              {
                                  $e = array_fill(0, 64, 0);
                          
                                  /** @var ParagonIE_Sodium_Core_Curve25519_Ge_Cached[] $pi */
                          Severity: Major
                          Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 2 hrs to fix

                            Method ge_frombytes_negate_vartime has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function ge_frombytes_negate_vartime($s)
                                {
                                    static $d = null;
                                    if (!$d) {
                                        $d = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d);
                            Severity: Major
                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 2 hrs to fix

                              Method fe_invert has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function fe_invert(ParagonIE_Sodium_Core_Curve25519_Fe $Z)
                                  {
                                      $z = clone $Z;
                                      $t0 = self::fe_sq($z);
                                      $t1 = self::fe_sq($t0);
                              Severity: Minor
                              Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 hr to fix

                                Method ge_mul_l has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public static function ge_mul_l(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A)
                                    {
                                        $aslide = array(
                                            13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0,
                                            0, 0, 0, -3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 3, 0,
                                Severity: Minor
                                Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 hr to fix

                                  Method slide has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public static function slide($a)
                                      {
                                          if (self::strlen($a) < 256) {
                                              if (self::strlen($a) < 16) {
                                                  $a = str_pad($a, 256, '0', STR_PAD_RIGHT);
                                  Severity: Minor
                                  Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 hr to fix

                                    Method sc25519_invert has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function sc25519_invert($s)
                                        {
                                            $_10 = self::sc25519_sq($s);
                                            $_11 = self::sc25519_mul($s, $_10);
                                            $_100 = self::sc25519_mul($s, $_11);
                                    Severity: Minor
                                    Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 hr to fix

                                      Method ge_select has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public static function ge_select($pos = 0, $b = 0)
                                          {
                                              static $base = null;
                                              if ($base === null) {
                                                  $base = array();
                                      Severity: Minor
                                      Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 hr to fix

                                        Method ge_scalarmult_base has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public static function ge_scalarmult_base($a)
                                            {
                                                /** @var array<int, int> $e */
                                                $e = array();
                                                $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();
                                        Severity: Minor
                                        Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 1 hr to fix

                                          Function ge_select has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              public static function ge_select($pos = 0, $b = 0)
                                              {
                                                  static $base = null;
                                                  if ($base === null) {
                                                      $base = array();
                                          Severity: Minor
                                          Found in wp-includes/sodium_compat/src/Core/Curve25519.php - 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

                                          Function fe_invert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                              public static function fe_invert(ParagonIE_Sodium_Core_Curve25519_Fe $Z)
                                              {
                                                  $z = clone $Z;
                                                  $t0 = self::fe_sq($z);
                                                  $t1 = self::fe_sq($t0);
                                          Severity: Minor
                                          Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 45 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

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                      for ($k = $i + $b; $k < 256; ++$k) {
                                                                          if (!$r[$k]) {
                                                                              $r[$k] = 1;
                                                                              break;
                                                                          }
                                          Severity: Major
                                          Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 45 mins to fix

                                            Function fe_pow22523 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                public static function fe_pow22523(ParagonIE_Sodium_Core_Curve25519_Fe $z)
                                                {
                                                    $z = self::fe_normalize($z);
                                                    # fe_sq(t0, z);
                                                    # fe_sq(t1, t0);
                                            Severity: Minor
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php - About 35 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

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

                                                public static function ge_mul_l(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A)
                                                {
                                                    $aslide = array(
                                                        13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0,
                                                        0, 0, 0, -3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 3, 0,
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 6 days to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 3107..3160

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

                                            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

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

                                                public static function fe_invert(ParagonIE_Sodium_Core_Curve25519_Fe $Z)
                                                {
                                                    $z = clone $Z;
                                                    $t0 = self::fe_sq($z);
                                                    $t1 = self::fe_sq($t0);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 3 days to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1136..1186

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

                                            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

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

                                                public static function ge_scalarmult_base($a)
                                                {
                                                    /** @var array<int, int> $e */
                                                    $e = array();
                                                    $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 2 days to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 2184..2234

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

                                            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

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

                                                    $s = array(
                                                        (int) (($h0 >> 0) & 0xff),
                                                        (int) (($h0 >> 8) & 0xff),
                                                        (int) (($h0 >> 16) & 0xff),
                                                        (int) ((($h0 >> 24) | ($h1 << 2)) & 0xff),
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 2 days to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 342..375

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

                                            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

                                                    $arr = array(
                                                        (int) ($s0 >> 0),
                                                        (int) ($s0 >> 8),
                                                        (int) (($s0 >> 16) | $s1 << 5),
                                                        (int) ($s1 >> 3),
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 1 day to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 3062..3095

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

                                            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

                                                public static function ge_add(
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p,
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q
                                                ) {
                                                    $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 3 other locations - About 1 day to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 1700..1719
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1359..1376
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1959..1978

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

                                            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

                                                public static function ge_sub(
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p,
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q
                                                ) {
                                                    $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 3 other locations - About 1 day to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 1130..1147
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1359..1376
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1959..1978

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

                                            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

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

                                                public static function ge_madd(
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R,
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p,
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q
                                                ) {
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 1 day to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1546..1564

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

                                            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

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

                                                public static function ge_msub(
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R,
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p,
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q
                                                ) {
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 1 day to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1576..1595

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

                                            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

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

                                                    for ($i = 0;$i < 256;++$i) {
                                                        if ($r[$i]) {
                                                            for ($b = 1;$b <= 6 && $i + $b < 256;++$b) {
                                                                if ($r[$i + $b]) {
                                                                    if ($r[$i] + ($r[$i + $b] << $b) <= 15) {
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 1 day to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1407..1429

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

                                            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

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

                                                public static function ge_p2_dbl(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $p)
                                                {
                                                    $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1();
                                            
                                                    $r->X = self::fe_sq($p->X);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 6 hrs to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1656..1671

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

                                            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

                                                    $s12 = self::mul($a1, $b11, 24) + self::mul($a2, $b10, 24) + self::mul($a3, $b9, 24) + self::mul($a4, $b8, 24) +
                                                           self::mul($a5, $b7, 24) + self::mul($a6, $b6, 24) + self::mul($a7, $b5, 24) + self::mul($a8, $b4, 24) +
                                                           self::mul($a9, $b3, 24) + self::mul($a10, $b2, 24) + self::mul($a11, $b1, 24);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 5 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3010..3012
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3016..3018

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

                                            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

                                                    $s12 = self::mul($a1, $b11, 22) + self::mul($a2, $b10, 22) + self::mul($a3, $b9, 22) + self::mul($a4, $b8, 22) +
                                                        self::mul($a5, $b7, 22) + self::mul($a6, $b6, 22) + self::mul($a7, $b5, 22) + self::mul($a8, $b4, 22) +
                                                        self::mul($a9, $b3, 22) + self::mul($a10, $b2, 22) + self::mul($a11, $b1, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 5 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2143..2145
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3010..3012

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

                                            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

                                                    $s10 = self::mul($a0, $b10, 22) + self::mul($a1, $b9, 22) + self::mul($a2, $b8, 22) + self::mul($a3, $b7, 22) +
                                                        self::mul($a4, $b6, 22) + self::mul($a5, $b5, 22) + self::mul($a6, $b4, 22) + self::mul($a7, $b3, 22) +
                                                        self::mul($a8, $b2, 22) + self::mul($a9, $b1, 22) + self::mul($a10, $b0, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 5 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2143..2145
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3016..3018

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

                                            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

                                                    $s11 = $c11 + self::mul($a0, $b11, 24) + self::mul($a1, $b10, 24) + self::mul($a2, $b9, 24) + self::mul($a3, $b8, 24) +
                                                           self::mul($a4, $b7, 24) + self::mul($a5, $b6, 24) + self::mul($a6, $b5, 24) + self::mul($a7, $b4, 24) +
                                                           self::mul($a8, $b3, 24) + self::mul($a9, $b2, 24) + self::mul($a10, $b1, 24) + self::mul($a11, $b0, 24);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 5 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2137..2139

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

                                            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

                                                    $s10 = $c10 + self::mul($a0, $b10, 24) + self::mul($a1, $b9, 24) + self::mul($a2, $b8, 24) + self::mul($a3, $b7, 24) +
                                                           self::mul($a4, $b6, 24) + self::mul($a5, $b5, 24) + self::mul($a6, $b4, 24) + self::mul($a7, $b3, 24) +
                                                           self::mul($a8, $b2, 24) + self::mul($a9, $b1, 24) + self::mul($a10, $b0, 24);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 5 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2140..2142

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

                                            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

                                                    $s13 = self::mul($a2, $b11, 22) + self::mul($a3, $b10, 22) + self::mul($a4, $b9, 22) + self::mul($a5, $b8, 22) +
                                                        self::mul($a6, $b7, 22) + self::mul($a7, $b6, 22) + self::mul($a8, $b5, 22) + self::mul($a9, $b4, 22) +
                                                        self::mul($a10, $b3, 22) + self::mul($a11, $b2, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 4 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2146..2148
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3007..3009

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

                                            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

                                                    $s13 = self::mul($a2, $b11, 24) + self::mul($a3, $b10, 24) + self::mul($a4, $b9, 24) + self::mul($a5, $b8, 24) +
                                                           self::mul($a6, $b7, 24) + self::mul($a7, $b6, 24) + self::mul($a8, $b5, 24) + self::mul($a9, $b4, 24) +
                                                           self::mul($a10, $b3, 24) + self::mul($a11, $b2, 24);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 4 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3007..3009
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3019..3021

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

                                            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

                                                    $s9 = self::mul($a0, $b9, 22) + self::mul($a1, $b8, 22) + self::mul($a2, $b7, 22) + self::mul($a3, $b6, 22) +
                                                        self::mul($a4, $b5, 22) + self::mul($a5, $b4, 22) + self::mul($a6, $b3, 22) + self::mul($a7, $b2, 22) +
                                                        self::mul($a8, $b1, 22) + self::mul($a9, $b0, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 4 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2146..2148
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3019..3021

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

                                            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

                                                    $s8 = self::mul($a0, $b8, 22) + self::mul($a1, $b7, 22) + self::mul($a2, $b6, 22) + self::mul($a3, $b5, 22) +
                                                        self::mul($a4, $b4, 22) + self::mul($a5, $b3, 22) + self::mul($a6, $b2, 22) + self::mul($a7, $b1, 22) +
                                                        self::mul($a8, $b0, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 3 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2149..2151
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3022..3024

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

                                            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

                                                    $s14 = self::mul($a3, $b11, 22) + self::mul($a4, $b10, 22) + self::mul($a5, $b9, 22) + self::mul($a6, $b8, 22) +
                                                        self::mul($a7, $b7, 22) + self::mul($a8, $b6, 22) + self::mul($a9, $b5, 22) + self::mul($a10, $b4, 22) +
                                                        self::mul($a11, $b3, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 3 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2149..2151
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3004..3006

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

                                            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

                                                    $s14 = self::mul($a3, $b11, 24) + self::mul($a4, $b10, 24) + self::mul($a5, $b9, 24) + self::mul($a6, $b8, 24) +
                                                           self::mul($a7, $b7, 24) + self::mul($a8, $b6, 24) + self::mul($a9, $b5, 24) + self::mul($a10, $b4, 24) +
                                                           self::mul($a11, $b3, 24);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 3 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3004..3006
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3022..3024

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

                                            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

                                                    $s7 = self::mul($a0, $b7, 22) + self::mul($a1, $b6, 22) + self::mul($a2, $b5, 22) + self::mul($a3, $b4, 22) +
                                                        self::mul($a4, $b3, 22) + self::mul($a5, $b2, 22) + self::mul($a6, $b1, 22) + self::mul($a7, $b0, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2152..2153
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3025..3026

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

                                            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

                                                    $s15 = self::mul($a4, $b11, 22) + self::mul($a5, $b10, 22) + self::mul($a6, $b9, 22) + self::mul($a7, $b8, 22) +
                                                        self::mul($a8, $b7, 22) + self::mul($a9, $b6, 22) + self::mul($a10, $b5, 22) + self::mul($a11, $b4, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2152..2153
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3002..3003

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

                                            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

                                                    $s15 = self::mul($a4, $b11, 24) + self::mul($a5, $b10, 24) + self::mul($a6, $b9, 24) + self::mul($a7, $b8, 24) +
                                                           self::mul($a8, $b7, 24) + self::mul($a9, $b6, 24) + self::mul($a10, $b5, 24) + self::mul($a11, $b4, 24);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3002..3003
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3025..3026

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

                                            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

                                                        if ($aslide[$i] > 0) {
                                                            # ge_p1p1_to_p3(&u,&t);
                                                            # ge_add(&t,&u,&Ai[aslide[i]/2]);
                                                            $u = self::ge_p1p1_to_p3($t);
                                                            $t = self::ge_add(
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 2125..2142

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

                                            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

                                                public static function ge_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $h)
                                                {
                                                    $recip = self::fe_invert($h->Z);
                                                    $x = self::fe_mul($h->X, $recip);
                                                    $y = self::fe_mul($h->Y, $recip);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 3 other locations - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 1478..1488
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1749..1759
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1988..1998

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

                                            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

                                                public static function ge_p3_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h)
                                                {
                                                    $recip = self::fe_invert($h->Z);
                                                    $x = self::fe_mul($h->X, $recip);
                                                    $y = self::fe_mul($h->Y, $recip);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 3 other locations - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 1729..1739
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1749..1759
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1988..1998

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

                                            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

                                                    $s16 = self::mul($a5, $b11, 24) + self::mul($a6, $b10, 24) + self::mul($a7, $b9, 24) + self::mul($a8, $b8, 24) +
                                                           self::mul($a9, $b7, 24) + self::mul($a10, $b6, 24) + self::mul($a11, $b5, 24);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3000..3001
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3027..3029

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

                                            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

                                                    $s6 = self::mul($a0, $b6, 22) + self::mul($a1, $b5, 22) + self::mul($a2, $b4, 22) + self::mul($a3, $b3, 22) +
                                                        self::mul($a4, $b2, 22) + self::mul($a5, $b1, 22) + self::mul($a6, $b0, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2154..2155
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3027..3029

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

                                            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

                                                    $s16 =
                                                        self::mul($a5, $b11, 22) + self::mul($a6, $b10, 22) + self::mul($a7, $b9, 22) + self::mul($a8, $b8, 22) +
                                                        self::mul($a9, $b7, 22) + self::mul($a10, $b6, 22) + self::mul($a11, $b5, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 2 hrs to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2154..2155
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3000..3001

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

                                            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

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

                                                public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p)
                                                {
                                                    $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P3();
                                                    $r->X = self::fe_mul($p->X, $p->T);
                                                    $r->Y = self::fe_mul($p->Y, $p->Z);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 1 hr to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1622..1630

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

                                            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

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

                                                public static function cmov(
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t,
                                                    ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u,
                                                    $b
                                                ) {
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 1 hr to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1839..1852

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

                                            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

                                                    $s17 = self::mul($a6, $b11, 24) + self::mul($a7, $b10, 24) + self::mul($a8, $b9, 24) + self::mul($a9, $b8, 24) +
                                                           self::mul($a10, $b7, 24) + self::mul($a11, $b6, 24);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 1 hr to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2998..2999
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3030..3031

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

                                            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

                                                    $s17 = self::mul($a6, $b11, 22) + self::mul($a7, $b10, 22) + self::mul($a8, $b9, 22) + self::mul($a9, $b8, 22) +
                                                        self::mul($a10, $b7, 22) + self::mul($a11, $b6, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 1 hr to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2156..2157
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2998..2999

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

                                            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

                                                    $s5 = self::mul($a0, $b5, 22) + self::mul($a1, $b4, 22) + self::mul($a2, $b3, 22) + self::mul($a3, $b2, 22) +
                                                        self::mul($a4, $b1, 22) + self::mul($a5, $b0, 22);
                                            Severity: Major
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 2 other locations - About 1 hr to fix
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 2156..2157
                                            wp-includes/sodium_compat/src/Core/Curve25519.php on lines 3030..3031

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

                                            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

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

                                                public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p)
                                                {
                                                    $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P2();
                                                    $r->X = self::fe_mul($p->X, $p->T);
                                                    $r->Y = self::fe_mul($p->Y, $p->Z);
                                            Severity: Minor
                                            Found in wp-includes/sodium_compat/src/Core/Curve25519.php and 1 other location - About 40 mins to fix
                                            wp-includes/sodium_compat/src/Core32/Curve25519.php on lines 1605..1612

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

                                            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

                                            There are no issues that match your filters.

                                            Category
                                            Status