cs306-versus/versus-app

View on GitHub
app/src/main/java/com/github/versus/ScheduleFragment.java

Summary

Maintainability
F
5 days
Test Coverage
F
57%

Consider simplifying this complex logical expression.
Confirmed

        if(months.get(month_index)==1 || months.get(month_index)==3 ||months.get(month_index)==5 ||months.get(month_index)==7 ||months.get(month_index)==8 ||months.get(month_index)==10 ||months.get(month_index)==12 ){
            if(number_date+7<=31){
                date.setText(String.valueOf((number_date+7)));

            }
Severity: Major
Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 1 hr to fix

    Avoid too many return statements within this method.
    Confirmed

            else if(month_index==8) return "August";
    Severity: Major
    Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Confirmed

              if(month_index==1) return "January";
      Severity: Major
      Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Confirmed

                else if(month_index==5) return "May";
        Severity: Major
        Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Confirmed

                  else if(month_index==6) return "June";
          Severity: Major
          Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Confirmed

                    else if(month_index==4) return "April";
            Severity: Major
            Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Confirmed

                      else if(month_index==2) return "February";
              Severity: Major
              Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Confirmed

                        else if(month_index==7) return "July";
                Severity: Major
                Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Confirmed

                          else if(month_index==3) return "March";
                  Severity: Major
                  Found in app/src/main/java/com/github/versus/ScheduleFragment.java - About 30 mins to fix

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

                            myImageView2.setOnClickListener(new View.OnClickListener(){
                                @Override
                                public void onClick(View v) {
                                    TextView date_monday =(TextView)view.findViewById(R.id.Monday_date);
                                    decrease_date(date_monday,0);
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 1 other location - About 5 hrs to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 297..326

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

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

                            myImageView.setOnClickListener(new View.OnClickListener(){
                                @Override
                                public void onClick(View v) {
                                    TextView date_monday =(TextView)view.findViewById(R.id.Monday_date);
                                    increase_date(date_monday,0);
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 1 other location - About 5 hrs to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 328..357

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

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

                            wednesdayButton.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                    
                                    TextView MondayText=(TextView)view.findViewById(R.id.Wednesday_date);
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 5 other locations - About 5 hrs to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 368..400
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 403..433
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 469..499
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 502..532
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 581..613

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

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

                            sundayButton.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                    
                                    TextView MondayText=(TextView)view.findViewById(R.id.Sunday_date);
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 5 other locations - About 5 hrs to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 368..400
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 403..433
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 436..466
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 469..499
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 502..532

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

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

                            tuesdayButton.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                    
                                    TextView MondayText=(TextView)view.findViewById(R.id.Tuesday_date);
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 5 other locations - About 5 hrs to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 368..400
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 436..466
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 469..499
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 502..532
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 581..613

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

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

                            thursdayButton.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                    
                                    TextView MondayText=(TextView)view.findViewById(R.id.Thursday_date);
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 5 other locations - About 5 hrs to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 368..400
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 403..433
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 436..466
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 502..532
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 581..613

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

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

                            fridayButton.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                    
                                    TextView MondayText=(TextView)view.findViewById(R.id.Friday_date);
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 5 other locations - About 5 hrs to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 368..400
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 403..433
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 436..466
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 469..499
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 581..613

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

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

                            mondayButton.setOnClickListener(new View.OnClickListener() {
                                @Override
                                public void onClick(View v) {
                    
                                    TextView MondayText=(TextView)view.findViewById(R.id.Monday_date);
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 5 other locations - About 5 hrs to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 403..433
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 436..466
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 469..499
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 502..532
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 581..613

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

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

                            if(months.get(month_index)==1 || months.get(month_index)==3 ||months.get(month_index)==5 ||months.get(month_index)==7 ||months.get(month_index)==8 ||months.get(month_index)==10 ||months.get(month_index)==12 ){
                                if(number_date+7<=31){
                                    date.setText(String.valueOf((number_date+7)));
                    
                                }
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 1 other location - About 1 hr to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 220..237

                    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 2 locations. Consider refactoring.
                    Confirmed

                            else if(months.get(month_index)!=2  ){
                                if(number_date+7<=30){
                                    date.setText(String.valueOf((number_date+7)));
                    
                                }
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 1 other location - About 1 hr to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 202..219

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

                            if(months.get(month_index)==5 ||months.get(month_index)==7  ||months.get(month_index)==10 ||months.get(month_index)==12 ){
                                if(number_date-7>0){
                                    date.setText(String.valueOf((number_date-7)));
                    
                                }
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 2 other locations - About 1 hr to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 181..198
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 163..180

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

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

                            else {
                                if(number_date-7>0){
                                    date.setText(String.valueOf((number_date-7)));
                    
                                }
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 2 other locations - About 1 hr to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 163..180
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 145..162

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

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

                            else if(months.get(month_index)!=3  ){
                                if(number_date-7>0){
                                    date.setText(String.valueOf((number_date-7)));
                    
                                }
                    Severity: Major
                    Found in app/src/main/java/com/github/versus/ScheduleFragment.java and 2 other locations - About 1 hr to fix
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 181..198
                    app/src/main/java/com/github/versus/ScheduleFragment.java on lines 145..162

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

                    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