dominance-analysis/dominance-analysis

View on GitHub
dominance_analysis/dominance_analysis/dominance.py

Summary

Maintainability
B
4 hrs
Test Coverage

File dominance.py has 437 lines of code (exceeds 250 allowed). Consider refactoring.
Wontfix

import numpy as np
from itertools import combinations
import sklearn
from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_breast_cancer
Severity: Minor
Found in dominance_analysis/dominance_analysis/dominance.py - About 6 hrs to fix

    Function predict_complete_dominance has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
    Wontfix

        def predict_complete_dominance(self):
            conditional_dominance_df=self.predict_conditional_dominance()
            conditional_dominant_predictors=list(conditional_dominance_df[conditional_dominance_df['Conditional Dominance']==True]['Predictors'].values)
            predictors=list(conditional_dominance_df['Predictors'].values)
    
    
    Severity: Minor
    Found in dominance_analysis/dominance_analysis/dominance.py - 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

    Function predict_conditional_dominance has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Wontfix

        def predict_conditional_dominance(self):
            
            general_dominance=[]
            l=list(self.dominance_stats().index)
            for index,i in enumerate(l):
    Severity: Minor
    Found in dominance_analysis/dominance_analysis/dominance.py - 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

    Function model_stats has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Wontfix

        def model_stats(self):
            # columns=list(self.data.columns.values)
            # columns.remove(self.target)
            # # print("Independent Variables : ",columns)
    
    
    Severity: Minor
    Found in dominance_analysis/dominance_analysis/dominance.py - 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

    Dominance has 23 functions (exceeds 20 allowed). Consider refactoring.
    Wontfix

    class Dominance:
        """docstring for ClassName"""
        def __init__(self,data,target,top_k=None,objective=1,pseudo_r2='mcfadden',data_format = 0): # Bala changes
            # super(ClassName, self).__init__()
            self.data = data
    Severity: Minor
    Found in dominance_analysis/dominance_analysis/dominance.py - About 2 hrs to fix

      Function complete_model_rsquare has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Wontfix

          def complete_model_rsquare(self):
              if(self.data_format==0): #Bala changes
                  print("Selecting %s Best Predictors for the Model" %self.top_k)
                  columns=self.get_top_k()
                  print("Selected Predictors : ",columns)
      Severity: Minor
      Found in dominance_analysis/dominance_analysis/dominance.py - 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 plot_waterfall_relative_importance has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Wontfix

          def plot_waterfall_relative_importance(self,incremental_rsquare_df):
              index = list(incremental_rsquare_df['Features'].values)
              data = {'Percentage Relative Importance': list(incremental_rsquare_df['percentage_incremental_r2'].values)}
              df = pd.DataFrame(data=data,index=index)
              
      Severity: Minor
      Found in dominance_analysis/dominance_analysis/dominance.py - About 1 hr to fix

        Avoid deeply nested control flow statements.
        Wontfix

                                for index,i in enumerate(self.variable_stats[predictor]['partial_dominance']):
                                    if(i<self.variable_stats[j]['partial_dominance'][index]):
                                        cd=False
                                        break
                    else:
        Severity: Major
        Found in dominance_analysis/dominance_analysis/dominance.py - About 45 mins to fix

          Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Wontfix

              def __init__(self,data,target,top_k=None,objective=1,pseudo_r2='mcfadden',data_format = 0): # Bala changes
          Severity: Minor
          Found in dominance_analysis/dominance_analysis/dominance.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Wontfix

                                    for search in search_index:
                                        # print(search[0],search[1],search[2],cds[j][search[0]][search[1]],cds[j][search[2]][search[1]])
                                        if(cds[j][search[0]][search[1]]<cds[j][search[2]][search[1]]):
                                            complete_dominance=False
                                            break
            Severity: Major
            Found in dominance_analysis/dominance_analysis/dominance.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Wontfix

                                      if(complete_dominance):
                                          for key in cds[j][i].keys():
                                              l=list(set(predictors)-set(key.split(" "))-set([i]))
                                              [search_index.append((i,key,c)) for c in l]
                                  
              Severity: Major
              Found in dominance_analysis/dominance_analysis/dominance.py - About 45 mins to fix

                Function variable_statistics has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Wontfix

                    def variable_statistics(self,model_rsquares,columns):
                        stats={}
                        complete_dominance_stats={}
                        # print(columns)
                        model_combinations=self.model_features_combination(columns)
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py - 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

                Function __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Wontfix

                    def __init__(self,data,target,top_k=None,objective=1,pseudo_r2='mcfadden',data_format = 0): # Bala changes
                        # super(ClassName, self).__init__()
                        self.data = data
                        self.target=target
                        self.objective=objective
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function partial_dominance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Wontfix

                    def partial_dominance(self,model_rsquares,model_features_k,model_features_k_minus_1,columns):
                        # print(columns)
                        pd={col: [] for col in columns}
                        [pd[" ".join(set(i)-set(j))].append(model_rsquares[" ".join(i)]-model_rsquares[" ".join(j)]) for i in model_features_k for j in model_features_k_minus_1 if(len(set(i)-set(j))==1)]
                
                
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

                Function plot_incremental_rsquare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Wontfix

                    def plot_incremental_rsquare(self):
                        incremental_rsquare_df1=pd.DataFrame()
                        incremental_rsquare_df1['Features']=self.incrimental_r2.keys()
                        incremental_rsquare_df1['incremental_r2']=self.incrimental_r2.values()
                        incremental_rsquare_df1.sort_values('incremental_r2',ascending=False,inplace=True)
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py - About 25 mins to fix

                Cognitive Complexity

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

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

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

                Further reading

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

                        if(self.objective):
                            top_k_vars=SelectKBest(f_regression, k=self.top_k)
                            top_k_vars.fit_transform(self.data[columns], self.data[self.target])
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 2 other locations - About 1 hr to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 253..255
                dominance_analysis/dominance_analysis/dominance.py on lines 256..258

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

                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

                            except:
                                top_k_vars=SelectKBest(f_classif, k=self.top_k)
                                top_k_vars.fit_transform(self.data[columns], self.data[self.target])
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 2 other locations - About 1 hr to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 248..250
                dominance_analysis/dominance_analysis/dominance.py on lines 253..255

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

                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

                            try:
                                top_k_vars=SelectKBest(chi2, k=self.top_k)
                                top_k_vars.fit_transform(self.data[columns], self.data[self.target])
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 2 other locations - About 1 hr to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 248..250
                dominance_analysis/dominance_analysis/dominance.py on lines 256..258

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

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

                        for index,i in enumerate(l):
                            general_dominance.append({"Predictors":i,"Dominating":l[index+1:]})
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 1 other location - About 1 hr to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 342..343

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

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

                        for index,i in enumerate(l):
                            general_dominance.append({"Predictors":i,"Dominating":l[index+1:]})
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 1 other location - About 1 hr to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 333..334

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

                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

                                    if((self.variable_stats[predictor]['individual_dominance']<self.variable_stats[j]['individual_dominance']) or (self.variable_stats[predictor]['conditional_dominance']<self.variable_stats[j]['conditional_dominance'])):
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py and 1 other location - About 45 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 351..351

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

                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 5 locations. Consider refactoring.
                Wontfix

                        try:
                            result=log_clf.fit(disp=0)
                        except:
                            result=log_clf.fit(disp=0,method='powell')
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 4 other locations - About 40 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 94..97
                dominance_analysis/dominance_analysis/dominance.py on lines 107..110
                dominance_analysis/dominance_analysis/dominance.py on lines 124..127
                dominance_analysis/dominance_analysis/dominance.py on lines 153..156

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

                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 5 locations. Consider refactoring.
                Wontfix

                        try:
                            result=log_clf.fit(disp=0)
                        except:
                            result=log_clf.fit(disp=0,method='powell')
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 4 other locations - About 40 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 94..97
                dominance_analysis/dominance_analysis/dominance.py on lines 107..110
                dominance_analysis/dominance_analysis/dominance.py on lines 124..127
                dominance_analysis/dominance_analysis/dominance.py on lines 141..144

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

                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 5 locations. Consider refactoring.
                Wontfix

                        try:
                            result=log_clf.fit(disp=0)
                        except:
                            result=log_clf.fit(disp=0,method='powell')
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 4 other locations - About 40 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 94..97
                dominance_analysis/dominance_analysis/dominance.py on lines 107..110
                dominance_analysis/dominance_analysis/dominance.py on lines 141..144
                dominance_analysis/dominance_analysis/dominance.py on lines 153..156

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

                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 5 locations. Consider refactoring.
                Wontfix

                        try:
                            result=log_clf.fit(disp=0)
                        except:
                            result=log_clf.fit(disp=0,method='powell')
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 4 other locations - About 40 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 107..110
                dominance_analysis/dominance_analysis/dominance.py on lines 124..127
                dominance_analysis/dominance_analysis/dominance.py on lines 141..144
                dominance_analysis/dominance_analysis/dominance.py on lines 153..156

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

                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 5 locations. Consider refactoring.
                Wontfix

                        try:
                            result=log_clf.fit(disp=0)
                        except:
                            result=log_clf.fit(disp=0,method='powell')
                Severity: Major
                Found in dominance_analysis/dominance_analysis/dominance.py and 4 other locations - About 40 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 94..97
                dominance_analysis/dominance_analysis/dominance.py on lines 124..127
                dominance_analysis/dominance_analysis/dominance.py on lines 141..144
                dominance_analysis/dominance_analysis/dominance.py on lines 153..156

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

                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

                        breast_cancer_data=pd.DataFrame(data=load_breast_cancer()['data'],columns=load_breast_cancer()['feature_names'])
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py and 1 other location - About 30 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 558..558

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

                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

                            print("Creating models for %s possible combinations of %s features :"%((2**len(columns))-1,len(columns)))
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py and 1 other location - About 30 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 524..524

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

                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

                        print("Calculating R2 for %s possible combinations of %s features :"%((2**len(columns))-1,len(columns)))
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py and 1 other location - About 30 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 434..434

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

                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

                        boston_data=pd.DataFrame(data=load_boston()['data'],columns=load_boston()['feature_names'])
                Severity: Minor
                Found in dominance_analysis/dominance_analysis/dominance.py and 1 other location - About 30 mins to fix
                dominance_analysis/dominance_analysis/dominance.py on lines 548..548

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

                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