paspao/MobiStego

View on GitHub

Showing 54 of 54 total issues

File GPU.java has 398 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package it.mobistego.utils;

/**
 * http://blog.kibotu.net/3d/how-to-get-android-opengl-1-0-2-0-information-constrains-revisited
 * <p/>
Severity: Minor
Found in MobiStego/src/main/java/it/mobistego/utils/GPU.java - About 5 hrs to fix

    Method encodeMessage has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

        private static byte[] encodeMessage(int[] oneDPix, int imgCols, int imgRows,
                                            MessageEncodingStatus message, ProgressHandler hand) {
    
            int channels = 3;
            int shiftIndex = 4;
    Severity: Minor
    Found in MobiStego/src/main/java/it/mobistego/business/LSB2bit.java - About 4 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 Utility.java has 303 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package it.mobistego.utils;
    
    import android.content.Context;
    import android.database.Cursor;
    import android.graphics.Bitmap;
    Severity: Minor
    Found in MobiStego/src/main/java/it/mobistego/utils/Utility.java - About 3 hrs to fix

      Method onClick has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @Override
          public void onClick(View v) {
              if (v != null) {
                  int id = v.getId();
                  switch (id) {
      Severity: Major
      Found in MobiStego/src/main/java/it/mobistego/fragments/MainFragment.java - About 2 hrs to fix

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

            @Override
            protected MobiStegoItem doInBackground(MobiStegoItem... params) {
                MobiStegoItem result = null;
                maxProgeress = 0;
                if (params.length > 0) {
        Severity: Major
        Found in MobiStego/src/main/java/it/mobistego/tasks/EncodeTask.java - About 2 hrs to fix

          Method decodeMessage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              private static void decodeMessage(byte[] oneDPix, int imgCols,
                                                int imgRows, MessageDecodingStatus mesg) {
          
                  Vector<Byte> v = new Vector<>();
          
          
          Severity: Minor
          Found in MobiStego/src/main/java/it/mobistego/business/LSB2bit.java - 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 onActivityResult has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public void onActivityResult(int requestCode, int resultCode, Intent data) {
                  super.onActivityResult(requestCode, resultCode, data);
                  //if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
                  File f = new File(Environment.getExternalStorageDirectory(),
          Severity: Minor
          Found in MobiStego/src/main/java/it/mobistego/fragments/MainFragment.java - 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

          Method splitImage has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
          Open

              public static List<Bitmap> splitImage(Bitmap bitmap) {
          
                  //For the number of rows and columns of the grid to be displayed
          
          
          
          Severity: Minor
          Found in MobiStego/src/main/java/it/mobistego/utils/Utility.java - 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

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

              public static List<Bitmap> encodeMessage(List<Bitmap> splittedImages,
                                                       String str, ProgressHandler hand) {
                  List<Bitmap> result = new ArrayList<>(splittedImages.size());
                  str += END_MESSAGE_CONSTANT;
                  str = START_MESSAGE_CONSTANT + str;
          Severity: Minor
          Found in MobiStego/src/main/java/it/mobistego/business/LSB2bit.java - About 1 hr to fix

            Method getView has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                public View getView(final int position, View convertView, ViewGroup parent) {
            
                    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            
            
            Severity: Minor
            Found in MobiStego/src/main/java/it/mobistego/adapters/ListAdapter.java - About 1 hr to fix

              Method doInBackground has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  protected MobiStegoItem doInBackground(MobiStegoItem... params) {
                      MobiStegoItem result = null;
                      maxProgeress = 0;
                      if (params.length > 0) {
              Severity: Minor
              Found in MobiStego/src/main/java/it/mobistego/tasks/EncodeTask.java - 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

              Method encodeMessage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static List<Bitmap> encodeMessage(List<Bitmap> splittedImages,
                                                           String str, ProgressHandler hand) {
                      List<Bitmap> result = new ArrayList<>(splittedImages.size());
                      str += END_MESSAGE_CONSTANT;
                      str = START_MESSAGE_CONSTANT + str;
              Severity: Minor
              Found in MobiStego/src/main/java/it/mobistego/business/LSB2bit.java - 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

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

                  private static void decodeMessage(byte[] oneDPix, int imgCols,
                                                    int imgRows, MessageDecodingStatus mesg) {
              
                      Vector<Byte> v = new Vector<>();
              
              
              Severity: Minor
              Found in MobiStego/src/main/java/it/mobistego/business/LSB2bit.java - About 1 hr to fix

                Method onActivityResult has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    public void onActivityResult(int requestCode, int resultCode, Intent data) {
                        super.onActivityResult(requestCode, resultCode, data);
                        //if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
                        File f = new File(Environment.getExternalStorageDirectory(),
                Severity: Minor
                Found in MobiStego/src/main/java/it/mobistego/fragments/MainFragment.java - About 1 hr to fix

                  Method saveMobiStegoItem has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static MobiStegoItem saveMobiStegoItem(String message, Bitmap srcEncoded, Context ctx) throws IOException {
                  
                          String name = UUID.randomUUID().toString();
                  
                          String fileNameOriginalPng = name + Constants.FILE_PNG_EXT;
                  Severity: Minor
                  Found in MobiStego/src/main/java/it/mobistego/utils/Utility.java - About 1 hr to fix

                    Method toString has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            @NonNull
                            @Override
                            public String toString() {
                                return "OpenGLGles20Info{" +
                                        "GL_RENDERER='" + GL_RENDERER + '\'' +
                    Severity: Minor
                    Found in MobiStego/src/main/java/it/mobistego/utils/GPU.java - About 1 hr to fix

                      Method equals has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                              @Override
                              public boolean equals(Object o) {
                                  if (this == o) return true;
                                  if (o == null || getClass() != o.getClass()) return false;
                      
                      
                      Severity: Minor
                      Found in MobiStego/src/main/java/it/mobistego/utils/GPU.java - 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

                      Method loadOnCreate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              @Override
                              protected void loadOnCreate() {
                      
                                  GL_RENDERER = glGetString(GLES10.GL_RENDERER);
                                  GL_VERSION = glGetString(GLES10.GL_VERSION);
                      Severity: Minor
                      Found in MobiStego/src/main/java/it/mobistego/utils/GPU.java - About 1 hr to fix

                        Method encodeMessage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private static byte[] encodeMessage(int[] oneDPix, int imgCols, int imgRows,
                                                                MessageEncodingStatus message, ProgressHandler hand) {
                        
                                int channels = 3;
                                int shiftIndex = 4;
                        Severity: Minor
                        Found in MobiStego/src/main/java/it/mobistego/business/LSB2bit.java - About 1 hr to fix

                          Method onCreateView has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              @Override
                              public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
                                  List<MobiStegoItem> mobiTmp;
                          
                                  mobiTmp = Utility.listMobistegoItem(getActivity());
                          Severity: Minor
                          Found in MobiStego/src/main/java/it/mobistego/fragments/MainFragment.java - 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

                          Severity
                          Category
                          Status
                          Source
                          Language