whylabs/whylogs-python

View on GitHub

Showing 225 of 3,656 total issues

Avoid too many return statements within this function.
Open

            return PreprocessedColumn.apply(list_format)
Severity: Major
Found in python/whylogs/core/preprocessing.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return PreprocessedColumn.apply(list_format)
    Severity: Major
    Found in python/whylogs/core/preprocessing.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return result
      Severity: Major
      Found in python/whylogs/core/preprocessing.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return False
        Severity: Major
        Found in python/whylogs/core/datatypes.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return result
          Severity: Major
          Found in python/whylogs/core/preprocessing.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return not self._right(metric or x)  # type: ignore
            Severity: Major
            Found in python/whylogs/core/relations.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return x >= value
              Severity: Major
              Found in python/whylogs/core/relations.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return Predicate(Relation.leq, value, component=component), i
                Severity: Major
                Found in python/whylogs/core/predicate_parser.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return Predicate(Relation._and, left=left, right=right, component=left._component), i
                  Severity: Major
                  Found in python/whylogs/core/predicate_parser.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return Predicate(Relation._not, right=right, component=right._component), i
                    Severity: Major
                    Found in python/whylogs/core/predicate_parser.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return result
                      Severity: Major
                      Found in python/whylogs/core/preprocessing.py - About 30 mins to fix

                        Function _process_dicts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def _process_dicts(
                                self,
                                dicts: List[DictType],
                                reducer: Callable[[DictType, DictType], DictType],
                                pre_processor: Callable[[DictType], Tuple[TrackData, int]],

                        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 _histogram_from_sketch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def _histogram_from_sketch(
                            sketch: kll_doubles_sketch,
                            max_buckets: Optional[int] = None,
                            avg_per_bucket: Optional[float] = None,
                            min_n_buckets: Optional[int] = None,
                        Severity: Minor
                        Found in python/whylogs/viz/utils/histogram_calculations.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 _validate_timestamp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def _validate_timestamp(timestamp: Union[date, datetime, pd.Timestamp, str]) -> datetime:
                            if isinstance(timestamp, pd.Timestamp):
                                return timestamp.to_pydatetime()
                            if isinstance(timestamp, str):
                                try:
                        Severity: Minor
                        Found in python/whylogs/datasets/utils.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 truncate_time_ms has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def truncate_time_ms(t: int, granularity: TimeGranularity) -> int:
                            dt = datetime.fromtimestamp(t / 1000, tz=tz.tzutc()).replace(second=0, microsecond=0)
                        
                            if granularity == TimeGranularity.Minute:
                                trunc = dt
                        Severity: Minor
                        Found in python/whylogs/api/logger/experimental/logger/actor/time_util.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

                        Method toSummaryDict has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          public HashMap<String, Object> toSummaryDict(
                              Optional<String> columnMetric, Optional<SummaryConfig> config) throws UnsupportedError {
                            SummaryConfig summaryConfig = config.orElse(new SummaryConfig());
                            HashMap<String, Object> summary = new HashMap<>();
                        
                        
                        Severity: Minor
                        Found in java/core/src/main/java/com/whylogs/core/views/ColumnProfileView.java - 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

                        Method getMetricComponentPaths has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          public List<String> getMetricComponentPaths() {
                            ArrayList<String> paths = new ArrayList<>();
                            for (String metricName : this.getMetricNames()) {
                              Optional<Metric<?>> metric = this.getMetric(metricName);
                              if (metric.isPresent()) {
                        Severity: Minor
                        Found in java/core/src/main/java/com/whylogs/core/views/ColumnProfileView.java - 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 feature_statistics has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def feature_statistics(
                                self, feature_name: Union[str, List[str]], profile: str = "reference", cell_height: Optional[str] = None
                            ) -> HTML:
                                """
                                Generate a report for the main statistics of specified feature, for a given profile (target or reference).
                        Severity: Minor
                        Found in python/whylogs/viz/notebook_profile_viz.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 zero_padding_frequent_items has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def zero_padding_frequent_items(
                            target_feature_items: List[FrequentItemEstimate], reference_feature_items: List[FrequentItemEstimate]
                        ) -> Tuple[List[FrequentItemEstimate], List[FrequentItemEstimate]]:
                            """Fills estimate value of item with 0 when such item is present in the other profile but absent in the current profile.
                            This is done for both profiles passed.
                        Severity: Minor
                        Found in python/whylogs/viz/utils/frequent_items_calculations.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 is_k_item_relevant has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def is_k_item_relevant(self, row: pd.core.series.Series, k: int) -> int:
                                if self.convert_non_numeric:
                                    return 1 if row[self.prediction_column][k - 1] in row[self.target_column] else 0
                                else:
                                    index_ki = row[self.prediction_column].index(k)
                        Severity: Minor
                        Found in python/whylogs/experimental/api/logger/__init__.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

                        Severity
                        Category
                        Status
                        Source
                        Language