Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Feb 22, 2023

Branch master refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch origin sourcery/master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from cccczl February 22, 2023 13:04
Copy link
Author

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery timed out performing refactorings.

Due to GitHub API limits, only the first 60 comments can be shown.

if self.line_before_msg:
_stdout.write("\n")
_stdout.write(self.preambule + " ... " + s)
_stdout.write(f"{self.preambule} ... {s}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PreambuleStream.write_msg refactored with the following changes:

def getDescription(test):
doc_first_line = test.shortDescription()
if doc_first_line:
if doc_first_line := test.shortDescription():
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function QuietTestResult.getDescription refactored with the following changes:

Comment on lines -94 to +95
print("%s: %s" % (flavour,self.getDescription(test)))
print(f"{flavour}: {self.getDescription(test)}")
print(self.separator2)
print("%s" % err)
print(f"{err}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function QuietTestResult.printErrorList refactored with the following changes:

Comment on lines -87 to +99
INSTALL_REQUIRES = sorted(set(
line.partition('#')[0].strip()
for file in (os.path.join(os.path.dirname(__file__), file)
for file in requirements)
for line in open(file)
) - {''})
INSTALL_REQUIRES = sorted(
(
{
line.partition('#')[0].strip()
for file in (
os.path.join(os.path.dirname(__file__), file)
for file in requirements
)
for line in open(file)
}
- {''}
)
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 87-92 refactored with the following changes:

Comment on lines -173 to +180
FULLVERSION += '.dev0+' + GIT_REVISION[:7]
FULLVERSION += f'.dev0+{GIT_REVISION[:7]}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function write_version_py refactored with the following changes:

Comment on lines -522 to +515
return super().__repr__() + ' # params=' + repr(self.params)
return f'{super().__repr__()} # params={repr(self.params)}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SklModel.__repr__ refactored with the following changes:

)
# first argument is 'self'
assert spec[0] == "self"
return {name: values[name] for name in spec[1:] if name in values}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SklLearner._get_sklparams refactored with the following changes:

Comment on lines -675 to 667
def __call__(self, data, ret=Model.Value):
if isinstance(data, Table):
with data.force_unlocked(data.X):
return super().__call__(data, ret)
else:
if not isinstance(data, Table):
return super().__call__(data, ret)
with data.force_unlocked(data.X):
return super().__call__(data, ret)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CatGBModel.__call__ refactored with the following changes:

Comment on lines -692 to +680
return super().__repr__() + ' # params=' + repr(self.params)
return f'{super().__repr__()} # params={repr(self.params)}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CatGBModel.__repr__ refactored with the following changes:

Comment on lines -96 to -101
vals = [attr.values[j] for j in sorted(child.condition)]
if not vals:
child.description = "(unreachable)"
if vals := [attr.values[j] for j in sorted(child.condition)]:
child.description = (
vals[0]
if len(vals) == 1
else f'{", ".join(vals[:-1])} or {vals[-1]}'
)
else:
child.description = vals[0] if len(vals) == 1 else \
"{} or {}".format(", ".join(vals[:-1]), vals[-1])
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function MappedDiscreteNode._set_child_descriptions refactored with the following changes:

Comment on lines -128 to +130
child.description = \
"{} {}".format("≤>"[child_idx], attr.str_val(threshold))
child.description = f'{"≤>"[child_idx]} {attr.str_val(threshold)}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function NumericNode._set_child_descriptions refactored with the following changes:

Comment on lines -208 to +214
else:
sums = np.sum(predictions, axis=1)
# This can't happen because nodes with 0 instances are prohibited
# zeros = (sums == 0)
# predictions[zeros] = 1
# sums[zeros] = predictions.shape[1]
return predictions / sums[:, np.newaxis]
sums = np.sum(predictions, axis=1)
# This can't happen because nodes with 0 instances are prohibited
# zeros = (sums == 0)
# predictions[zeros] = 1
# sums[zeros] = predictions.shape[1]
return predictions / sums[:, np.newaxis]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TreeModel.predict refactored with the following changes:

def get_indices(self, nodes):
subsets = [node.subset for node in nodes]
if subsets:
if subsets := [node.subset for node in nodes]:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TreeModel.get_indices refactored with the following changes:

Comment on lines -262 to +267
rules.append("{} > {}".format(name, attr.repr_val(lower)))
rules.append(f"{name} > {attr.repr_val(lower)}")
elif lower is None:
rules.append("{} ≤ {}".format(name, attr.repr_val(upper)))
rules.append(f"{name}{attr.repr_val(upper)}")
else:
rules.append("{} < {} ≤ {}".format(
attr.repr_val(lower), name, attr.repr_val(upper)))
rules.append(f"{attr.repr_val(lower)} < {name}{attr.repr_val(upper)}")
else:
rules.append("{}: {}".format(name, node.description))
rules.append(f"{name}: {node.description}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TreeModel.rule refactored with the following changes:

'old behavior'
"""
alternative = ('; Instead, use ' + obj) if isinstance(obj, str) else ''
alternative = f'; Instead, use {obj}' if isinstance(obj, str) else ''
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function deprecated refactored with the following changes:

Comment on lines -113 to +110
if ret == Model.Value:
return vals
else:
return vals, cal_probs
return vals if ret == Model.Value else (vals, cal_probs)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CalibratedClassifier.__call__ refactored with the following changes:

Comment on lines -174 to +168
calibrators = [fitter.fit(cls_probs, ytrue)
for cls_idx, cls_probs in enumerate(probabilities.T)]
calibrators = [fitter.fit(cls_probs, ytrue) for cls_probs in probabilities.T]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CalibratedLearner.get_model refactored with the following changes:

solver = "liblinear"
else:
solver = "lbfgs"
solver = "liblinear" if penalty == "l1" else "lbfgs"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function LogisticRegressionLearner._initialize_wrapped refactored with the following changes:


def __str__(self):
return 'ConstantModel {}'.format(self.dist)
return f'ConstantModel {self.dist}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ConstantModel.__str__ refactored with the following changes:

y *= x.sum() / y.sum()
lrs = 2 * (x * np.log(x/y)).sum()
return lrs
return 2 * (x * np.log(x/y)).sum()
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function likelihood_ratio_statistic refactored with the following changes:

Comment on lines +210 to -218
p_cond = dist_sum / p_dist_sum
if tc is not None:
p_cond = dist_sum / p_dist_sum
# p_cond = dist[tc] / p_dist[tc]
p_true_positive = dist[tc] / dist_sum
p_class = p_dist[tc] / p_dist_sum
else:
# generality of the rule
p_cond = dist_sum / p_dist_sum
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function WeightedRelativeAccuracyEvaluator.evaluate_rule refactored with the following changes:

This removes the following comments ( why? ):

# generality of the rule

Comment on lines -557 to +554
# remove redundant selectors
possible_selectors = [smh for smh in possible_selectors if
smh not in existing_selectors]

return possible_selectors
return [smh for smh in possible_selectors if smh not in existing_selectors]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TopDownSearchStrategy.find_new_selectors refactored with the following changes:

This removes the following comments ( why? ):

# remove redundant selectors

Comment on lines -787 to +783
attributes = self.domain.attributes
class_var = self.domain.class_var

if self.selectors:
attributes = self.domain.attributes
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Rule.__str__ refactored with the following changes:

Comment on lines -1284 to +1278
if not rule_list or rule_list and rule_list[-1].length > 0:
if not rule_list or rule_list[-1].length > 0:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function CN2Learner.fit_storage refactored with the following changes:

if len(data.domain.class_vars) != 1:
n_cls = len(data.domain.class_vars)
raise ValueError("Number of classes should be 1: {}".format(n_cls))
raise ValueError(f"Number of classes should be 1: {n_cls}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function SimpleTreeModel.__init__ refactored with the following changes:

Comment on lines -372 to +374
depths = {}
depths[cluster] = 0
depths = {cluster: 0}
for cluster in preorder(cluster):
cl_depth = depths[cluster]
depths.update(dict.fromkeys(cluster.branches, cl_depth + 1))
depths |= dict.fromkeys(cluster.branches, cl_depth + 1)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function cluster_depths refactored with the following changes:

Comment on lines -178 to +181
indices.update(chain.from_iterable(
((var, -1-idx), (var.name, -1-idx), (-1-idx, -1-idx))
for idx, var in enumerate(self.metas)))
indices |= chain.from_iterable(
((var, -1 - idx), (var.name, -1 - idx), (-1 - idx, -1 - idx))
for idx, var in enumerate(self.metas)
)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Domain._ensure_indices refactored with the following changes:

Comment on lines -226 to +227
return base if not places \
else "{} {:0{}}".format(base, index + 1, places)
return "{} {:0{}}".format(base, index + 1, places) if places else base
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Domain.from_numpy refactored with the following changes:

myvar = self.variables[index]
else:
myvar = self.metas[-1 - index]
myvar = self.variables[index] if index >= 0 else self.metas[-1 - index]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Domain._get_equivalent refactored with the following changes:

Comment on lines -321 to +318
if index >= 0:
return self.variables[index]
else:
return self.metas[-1 - index]
return self.variables[index] if index >= 0 else self.metas[-1 - index]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Domain.__getitem__ refactored with the following changes:

@sourcery-ai
Copy link
Author

sourcery-ai bot commented Feb 22, 2023

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.01%.

Quality metrics Before After Change
Complexity 6.04 ⭐ 5.88 ⭐ -0.16 👍
Method Length 78.60 🙂 78.51 🙂 -0.09 👍
Working memory 6.74 🙂 6.78 🙂 0.04 👎
Quality 65.92% 🙂 65.93% 🙂 0.01% 👍
Other metrics Before After Change
Lines 49594 49228 -366
Changed files Quality Before Quality After Quality Change
quietunittest.py 93.29% ⭐ 93.11% ⭐ -0.18% 👎
setup.py 73.85% 🙂 73.82% 🙂 -0.03% 👎
Orange/base.py 58.10% 🙂 58.41% 🙂 0.31% 👍
Orange/tree.py 64.88% 🙂 64.21% 🙂 -0.67% 👎
Orange/util.py 80.19% ⭐ 80.45% ⭐ 0.26% 👍
Orange/canvas/__main__.py 51.20% 🙂 51.20% 🙂 0.00%
Orange/canvas/config.py 84.51% ⭐ 84.28% ⭐ -0.23% 👎
Orange/classification/calibration.py 77.47% ⭐ 77.97% ⭐ 0.50% 👍
Orange/classification/logistic_regression.py 83.55% ⭐ 83.73% ⭐ 0.18% 👍
Orange/classification/majority.py 73.47% 🙂 73.49% 🙂 0.02% 👍
Orange/classification/rules.py 70.59% 🙂 70.75% 🙂 0.16% 👍
Orange/classification/simple_tree.py 53.04% 🙂 52.83% 🙂 -0.21% 👎
Orange/classification/svm.py 72.79% 🙂 72.68% 🙂 -0.11% 👎
Orange/classification/tree.py 34.33% 😞 34.15% 😞 -0.18% 👎
Orange/clustering/clustering.py 61.71% 🙂 62.32% 🙂 0.61% 👍
Orange/clustering/hierarchical.py 72.23% 🙂 71.81% 🙂 -0.42% 👎
Orange/data/domain.py 60.37% 🙂 60.24% 🙂 -0.13% 👎
Orange/data/filter.py 69.80% 🙂 69.31% 🙂 -0.49% 👎
Orange/data/instance.py 74.51% 🙂 74.56% 🙂 0.05% 👍
Orange/data/io.py 73.71% 🙂 73.32% 🙂 -0.39% 👎
Orange/data/io_base.py 72.71% 🙂 72.84% 🙂 0.13% 👍
Orange/data/pandas_compat.py 45.67% 😞 45.68% 😞 0.01% 👍
Orange/data/table.py 46.39% 😞 46.40% 😞 0.01% 👍
Orange/data/util.py 72.00% 🙂 71.36% 🙂 -0.64% 👎
Orange/data/variable.py 68.53% 🙂 67.62% 🙂 -0.91% 👎
Orange/data/sql/filter.py 62.34% 🙂 57.10% 🙂 -5.24% 👎
Orange/data/sql/table.py 66.56% 🙂 65.91% 🙂 -0.65% 👎
Orange/data/sql/backend/base.py 90.57% ⭐ 91.27% ⭐ 0.70% 👍
Orange/data/sql/backend/mssql.py 71.25% 🙂 71.90% 🙂 0.65% 👍
Orange/data/sql/backend/postgres.py 70.35% 🙂 71.37% 🙂 1.02% 👍
Orange/data/tests/test_io.py 74.82% 🙂 74.75% 🙂 -0.07% 👎
Orange/data/tests/test_pandas.py 68.67% 🙂 68.68% 🙂 0.01% 👍
Orange/data/tests/test_variable.py 74.30% 🙂 74.23% 🙂 -0.07% 👎
Orange/datasets/list_update.py 63.59% 🙂 64.37% 🙂 0.78% 👍
Orange/distance/base.py 63.89% 🙂 64.05% 🙂 0.16% 👍
Orange/distance/distance.py 67.49% 🙂 67.80% 🙂 0.31% 👍
Orange/distance/tests/test_distance.py 67.37% 🙂 67.37% 🙂 0.00%
Orange/ensembles/stack.py 73.05% 🙂 73.60% 🙂 0.55% 👍
Orange/evaluation/clustering.py 54.58% 🙂 54.59% 🙂 0.01% 👍
Orange/evaluation/scoring.py 82.67% ⭐ 82.97% ⭐ 0.30% 👍
Orange/evaluation/testing.py 52.86% 🙂 52.92% 🙂 0.06% 👍
Orange/evaluation/tests/test_performance_curves.py 55.00% 🙂 55.01% 🙂 0.01% 👍
Orange/misc/__init__.py 94.86% ⭐ 94.86% ⭐ 0.00%
Orange/misc/cache.py 78.51% ⭐ 78.62% ⭐ 0.11% 👍
Orange/misc/distmatrix.py 48.79% 😞 49.53% 😞 0.74% 👍
Orange/misc/environ.py 80.22% ⭐ 81.88% ⭐ 1.66% 👍
Orange/misc/lazy_module.py 94.50% ⭐ 94.44% ⭐ -0.06% 👎
Orange/misc/server_embedder.py 64.91% 🙂 65.23% 🙂 0.32% 👍
Orange/misc/wrapper_meta.py 58.08% 🙂 56.03% 🙂 -2.05% 👎
Orange/misc/utils/embedder_utils.py 89.67% ⭐ 90.35% ⭐ 0.68% 👍
Orange/modelling/base.py 78.15% ⭐ 79.53% ⭐ 1.38% 👍
Orange/preprocess/discretize.py 61.43% 🙂 61.74% 🙂 0.31% 👍
Orange/preprocess/fss.py 60.97% 🙂 62.43% 🙂 1.46% 👍
Orange/preprocess/impute.py 80.34% ⭐ 80.46% ⭐ 0.12% 👍
Orange/preprocess/normalize.py 69.81% 🙂 70.43% 🙂 0.62% 👍
Orange/preprocess/preprocess.py 71.68% 🙂 71.96% 🙂 0.28% 👍
Orange/preprocess/remove.py 75.01% ⭐ 74.93% 🙂 -0.08% 👎
Orange/preprocess/score.py 66.90% 🙂 66.83% 🙂 -0.07% 👎
Orange/preprocess/transformation.py 84.41% ⭐ 85.14% ⭐ 0.73% 👍
Orange/projection/base.py 89.40% ⭐ 89.63% ⭐ 0.23% 👍
Orange/projection/cur.py 72.43% 🙂 72.01% 🙂 -0.42% 👎
Orange/projection/freeviz.py 45.09% 😞 45.10% 😞 0.01% 👍
Orange/projection/manifold.py 58.78% 🙂 59.04% 🙂 0.26% 👍
Orange/projection/radviz.py 78.07% ⭐ 78.36% ⭐ 0.29% 👍
Orange/regression/curvefit.py 67.85% 🙂 67.74% 🙂 -0.11% 👎
Orange/regression/linear.py 81.39% ⭐ 81.40% ⭐ 0.01% 👍
Orange/regression/mean.py 92.19% ⭐ 92.25% ⭐ 0.06% 👍
Orange/regression/svm.py 72.96% 🙂 72.85% 🙂 -0.11% 👎
Orange/regression/tree.py 43.83% 😞 43.63% 😞 -0.20% 👎
Orange/statistics/contingency.py 58.06% 🙂 58.46% 🙂 0.40% 👍
Orange/statistics/distribution.py 73.40% 🙂 73.26% 🙂 -0.14% 👎
Orange/statistics/util.py 56.29% 🙂 56.66% 🙂 0.37% 👍
Orange/tests/test_base.py 88.25% ⭐ 88.27% ⭐ 0.02% 👍
Orange/tests/test_basket_reader.py 89.59% ⭐ 89.64% ⭐ 0.05% 👍
Orange/tests/test_classification.py 67.32% 🙂 67.54% 🙂 0.22% 👍
Orange/tests/test_clustering_hierarchical.py 73.71% 🙂 73.71% 🙂 0.00%
Orange/tests/test_contingency.py 68.85% 🙂 68.85% 🙂 0.00%
Orange/tests/test_distances.py 75.05% ⭐ 75.05% ⭐ 0.00%
Orange/tests/test_distribution.py 72.59% 🙂 72.59% 🙂 0.00%
Orange/tests/test_domain.py 77.49% ⭐ 77.50% ⭐ 0.01% 👍
Orange/tests/test_evaluation_scoring.py 79.42% ⭐ 79.45% ⭐ 0.03% 👍
Orange/tests/test_impute.py 74.74% 🙂 74.75% 🙂 0.01% 👍
Orange/tests/test_instance.py 74.75% 🙂 74.77% 🙂 0.02% 👍
Orange/tests/test_orangetree.py 70.87% 🙂 71.01% 🙂 0.14% 👍
Orange/tests/test_score_feature.py 74.87% 🙂 74.89% 🙂 0.02% 👍
Orange/tests/test_simple_tree.py 78.50% ⭐ 78.52% ⭐ 0.02% 👍
Orange/tests/test_tab_reader.py 76.47% ⭐ 76.43% ⭐ -0.04% 👎
Orange/tests/test_table.py 67.04% 🙂 66.96% 🙂 -0.08% 👎
Orange/tests/test_txt_reader.py 85.30% ⭐ 85.21% ⭐ -0.09% 👎
Orange/tests/test_xlsx_reader.py 72.16% 🙂 72.17% 🙂 0.01% 👍
Orange/tests/sql/base.py 68.25% 🙂 67.67% 🙂 -0.58% 👎
Orange/tests/sql/test_filter.py 77.28% ⭐ 77.29% ⭐ 0.01% 👍
Orange/tests/sql/test_sql_table.py 80.71% ⭐ 80.64% ⭐ -0.07% 👎
Orange/widgets/gui.py 68.32% 🙂 68.63% 🙂 0.31% 👍
Orange/widgets/settings.py 68.53% 🙂 68.46% 🙂 -0.07% 👎
Orange/widgets/data/owcolor.py 68.39% 🙂 68.43% 🙂 0.04% 👍
Orange/widgets/data/owconcatenate.py 59.14% 🙂 59.38% 🙂 0.24% 👍
Orange/widgets/data/owcontinuize.py 69.09% 🙂 69.02% 🙂 -0.07% 👎
Orange/widgets/data/owcorrelations.py 71.31% 🙂 71.32% 🙂 0.01% 👍
Orange/widgets/data/owcreateclass.py 50.53% 🙂 50.54% 🙂 0.01% 👍
Orange/widgets/data/owcreateinstance.py 69.49% 🙂 69.65% 🙂 0.16% 👍
Orange/widgets/data/owcsvimport.py 60.54% 🙂 60.40% 🙂 -0.14% 👎
Orange/widgets/data/owdatainfo.py 75.39% ⭐ 75.17% ⭐ -0.22% 👎
Orange/widgets/data/owdatasampler.py 56.59% 🙂 56.87% 🙂 0.28% 👍
Orange/widgets/data/owdatasets.py 69.15% 🙂 69.15% 🙂 0.00%
Orange/widgets/data/owdiscretize.py 57.90% 🙂 57.65% 🙂 -0.25% 👎
Orange/widgets/data/oweditdomain.py 61.11% 🙂 61.31% 🙂 0.20% 👍
Orange/widgets/data/owfeatureconstructor.py 62.83% 🙂 62.61% 🙂 -0.22% 👎
Orange/widgets/data/owfeaturestatistics.py 54.68% 🙂 54.43% 🙂 -0.25% 👎
Orange/widgets/data/owfile.py 57.51% 🙂 57.34% 🙂 -0.17% 👎
Orange/widgets/data/owgroupby.py 73.70% 🙂 74.02% 🙂 0.32% 👍
Orange/widgets/data/owimpute.py 56.50% 🙂 56.28% 🙂 -0.22% 👎
Orange/widgets/data/owmelt.py 64.10% 🙂 63.73% 🙂 -0.37% 👎
Orange/widgets/data/owmergedata.py 64.39% 🙂 64.36% 🙂 -0.03% 👎
Orange/widgets/data/owneighbors.py 75.43% ⭐ 75.17% ⭐ -0.26% 👎
Orange/widgets/data/owpaintdata.py 70.98% 🙂 71.29% 🙂 0.31% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
Orange/data/table.py Table.transpose 69 ⛔ 807 ⛔ 1.60% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
Orange/widgets/data/owfeatureconstructor.py freevars 70 ⛔ 658 ⛔ 29 ⛔ 2.11% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions
Orange/widgets/data/owfeaturestatistics.py FeatureStatisticsTableModel.data 54 ⛔ 531 ⛔ 4.31% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
Orange/base.py Model.__call__ 51 ⛔ 605 ⛔ 4.74% ⛔ Refactor to reduce nesting. Try splitting into smaller methods
Orange/widgets/data/owfeatureconstructor.py validate_exp 46 ⛔ 488 ⛔ 32 ⛔ 5.16% ⛔ Refactor to reduce nesting. Try splitting into smaller methods. Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant