yashketkar/video-player

View on GitHub
vitamio/src/io/vov/vitamio/utils/Base64.java

Summary

Maintainability
F
4 days
Test Coverage

Method process has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
Open

        public boolean process(byte[] input, int offset, int len, boolean finish) {
            // Using local variables makes the encoder about 9% faster.
            final byte[] alphabet = this.alphabet;
            final byte[] output = this.output;
            int op = 0;
Severity: Minor
Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 7 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 process has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
Open

        public boolean process(byte[] input, int offset, int len, boolean finish) {
            if (this.state == 6) return false;

            int p = offset;
            len += offset;
Severity: Minor
Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 6 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

File Base64.java has 380 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Severity: Minor
Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 5 hrs to fix

    Method process has 117 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public boolean process(byte[] input, int offset, int len, boolean finish) {
                if (this.state == 6) return false;
    
                int p = offset;
                len += offset;
    Severity: Major
    Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 4 hrs to fix

      Method process has 101 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public boolean process(byte[] input, int offset, int len, boolean finish) {
                  // Using local variables makes the encoder about 9% faster.
                  final byte[] alphabet = this.alphabet;
                  final byte[] output = this.output;
                  int op = 0;
      Severity: Major
      Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 4 hrs to fix

        Method encode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public static byte[] encode(byte[] input, int offset, int len, int flags) {
                Encoder encoder = new Encoder(flags, null);
        
                // Compute the exact length of the array we will produce.
                int output_len = len / 3 * 4;
        Severity: Minor
        Found in vitamio/src/io/vov/vitamio/utils/Base64.java - 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 too many return statements within this method.
        Open

                    return true;
        Severity: Major
        Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                                  return false;
          Severity: Major
          Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return false;
            Severity: Major
            Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return false;
              Severity: Major
              Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                        return false;
                Severity: Major
                Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return true;
                  Severity: Major
                  Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                            return false;
                    Severity: Major
                    Found in vitamio/src/io/vov/vitamio/utils/Base64.java - About 30 mins to fix

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

                              private static final byte ENCODE_WEBSAFE[] = {
                                  'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
                                  'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
                                  'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
                                  'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_',
                      Severity: Major
                      Found in vitamio/src/io/vov/vitamio/utils/Base64.java and 1 other location - About 2 hrs to fix
                      vitamio/src/io/vov/vitamio/utils/Base64.java on lines 552..557

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

                      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

                              private static final byte ENCODE[] = {
                                  'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
                                  'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
                                  'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
                                  'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/',
                      Severity: Major
                      Found in vitamio/src/io/vov/vitamio/utils/Base64.java and 1 other location - About 2 hrs to fix
                      vitamio/src/io/vov/vitamio/utils/Base64.java on lines 563..568

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

                      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

                                      if (--count == 0) {
                                          if (do_cr) output[op++] = '\r';
                                          output[op++] = '\n';
                                          count = LINE_GROUPS;
                                      }
                      Severity: Minor
                      Found in vitamio/src/io/vov/vitamio/utils/Base64.java and 1 other location - About 40 mins to fix
                      vitamio/src/io/vov/vitamio/utils/Base64.java on lines 648..652

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

                      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

                                      if (--count == 0) {
                                          if (do_cr) output[op++] = '\r';
                                          output[op++] = '\n';
                                          count = LINE_GROUPS;
                                      }
                      Severity: Minor
                      Found in vitamio/src/io/vov/vitamio/utils/Base64.java and 1 other location - About 40 mins to fix
                      vitamio/src/io/vov/vitamio/utils/Base64.java on lines 670..674

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

                      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